コード ```### 前提・実現したいこと ここに質問の内容を詳しく書いてください。 SSDを用いた物体検出を行っています。最終的には、画像中から、物体を検出します。 ### 発生している問題・エラーメッセージ
Using TensorFlow backend.
RuntimeError Traceback (most recent call last)
in
5 from keras.models import Model
6 from keras.preprocessing import image
----> 7 import matplotlib.pyplot as plt
8 import numpy as np
9 from scipy.misc import imread
/Library/Python/3.7/site-packages/matplotlib/init.py in
137 # cbook must import matplotlib only within function
138 # definitions, so it is safe to import from it here.
--> 139 from . import cbook, rcsetup
140 from matplotlib.cbook import (
141 MatplotlibDeprecationWarning, dedent, get_label, sanitize_sequence)
/Library/Python/3.7/site-packages/matplotlib/rcsetup.py in
25 from matplotlib import cbook
26 from matplotlib.cbook import ls_mapper
---> 27 from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
28 from matplotlib.colors import is_color_like
29
/Library/Python/3.7/site-packages/matplotlib/fontconfig_pattern.py in
16 import re
17 import numpy as np
---> 18 from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
19 ParseException, Suppress)
20
/Library/Python/3.7/site-packages/pyparsing.py in
5670 stringEnd = StringEnd().setName("stringEnd")
5671
-> 5672 _escapedPunc = Word(_bslash, r"[]-*.$+^?()~ ", exact=2).setParseAction(lambda s, l, t: t[0][1])
5673 _escapedHexChar = Regex(r"\0?[xX][0-9a-fA-F]+").setParseAction(lambda s, l, t: unichr(int(t[0].lstrip(r'\0x'), 16)))
5674 _escapedOctChar = Regex(r"\0[0-7]+").setParseAction(lambda s, l, t: unichr(int(t[0][1:], 8)))
/Library/Python/3.7/site-packages/pyparsing.py in setParseAction(self, *fns, **kwargs)
1561 if not all(callable(fn) for fn in fns):
1562 raise TypeError("parse actions must be callable")
-> 1563 self.parseAction = list(map(_trim_arity, list(fns)))
1564 self.callDuringTry = kwargs.get("callDuringTry", False)
1565 return self
/Library/Python/3.7/site-packages/pyparsing.py in _trim_arity(func, maxargs)
1308 # IF ANY CODE CHANGES, EVEN JUST COMMENTS OR BLANK LINES, BETWEEN THE NEXT LINE AND
1309 # THE CALL TO FUNC INSIDE WRAPPER, LINE_DIFF MUST BE MODIFIED!!!!
-> 1310 this_line = extract_stack(limit=2)[-1]
1311 pa_call_line_synth = (this_line[0], this_line[1] + LINE_DIFF)
1312
/Library/Python/3.7/site-packages/pyparsing.py in extract_stack(limit)
1292 # special handling for Python 3.5.0 - extra deep call stack by 1
1293 offset = -3 if system_version == (3, 5, 0) else -2
-> 1294 frame_summary = traceback.extract_stack(limit=-offset + limit - 1)[offset]
1295 return [frame_summary[:2]]
1296 def extract_tb(tb, limit=0):
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py in extract_stack(f, limit)
209 if f is None:
210 f = sys._getframe().f_back
--> 211 stack = StackSummary.extract(walk_stack(f), limit=limit)
212 stack.reverse()
213 return stack
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py in extract(klass, frame_gen, limit, lookup_lines, capture_locals)
361 if lookup_lines:
362 for f in result:
--> 363 f.line
364 return result
365
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py in line(self)
283 def line(self):
284 if self._line is None:
--> 285 self._line = linecache.getline(self.filename, self.lineno).strip()
286 return self._line
287
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py in getline(filename, lineno, module_globals)
14
15 def getline(filename, lineno, module_globals=None):
---> 16 lines = getlines(filename, module_globals)
17 if 1 <= lineno <= len(lines):
18 return lines[lineno-1]
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py in getlines(filename, module_globals)
46 try:
47 if module_globals is None:
---> 48 for mod in sys.modules.values():
49 if getattr(mod, 'file', None) == filename:
50 module_globals = mod.dict
RuntimeError: dictionary changed size during iteration
### 該当のソースコード import cv2 import keras from keras.applications.imagenet_utils import preprocess_input from keras.backend.tensorflow_backend import set_session from keras.models import Model from keras.preprocessing import image import matplotlib.pyplot as plt import numpy as np from scipy.misc import imread import tensorflow as tf from ssd import SSD300 from ssd_utils import BBoxUtility %matplotlib inline plt.rcParams['figure.figsize'] = (8, 8) plt.rcParams['image.interpolation'] = 'nearest' np.set_printoptions(suppress=True) config = tf.ConfigProto() config.gpu_options.per_process_gpu_memory_fraction = 0.45 set_session(tf.Session(config=config)) ```ここに言語名を入力 python
試したこと
TensorFlowやscipyのバージョンを変更したりした。
補足情報(FW/ツールのバージョンなど)
tensorflow 1.15.0
scipy 1.2.0
あなたの回答
tips
プレビュー