質問編集履歴
2
エラーメッセージをより詳細に書いた
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,196 @@
|
|
18
18
|
|
19
19
|
```
|
20
20
|
|
21
|
+
|
22
|
+
|
23
|
+
Using TensorFlow backend.
|
24
|
+
|
25
|
+
---------------------------------------------------------------------------
|
26
|
+
|
27
|
+
RuntimeError Traceback (most recent call last)
|
28
|
+
|
29
|
+
in
|
30
|
+
|
31
|
+
5 from keras.models import Model
|
32
|
+
|
33
|
+
6 from keras.preprocessing import image
|
34
|
+
|
35
|
+
----> 7 import matplotlib.pyplot as plt
|
36
|
+
|
37
|
+
8 import numpy as np
|
38
|
+
|
39
|
+
9 from scipy.misc import imread
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
/Library/Python/3.7/site-packages/matplotlib/__init__.py in
|
44
|
+
|
45
|
+
137 # cbook must import matplotlib only within function
|
46
|
+
|
47
|
+
138 # definitions, so it is safe to import from it here.
|
48
|
+
|
49
|
+
--> 139 from . import cbook, rcsetup
|
50
|
+
|
51
|
+
140 from matplotlib.cbook import (
|
52
|
+
|
53
|
+
141 MatplotlibDeprecationWarning, dedent, get_label, sanitize_sequence)
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
/Library/Python/3.7/site-packages/matplotlib/rcsetup.py in
|
58
|
+
|
59
|
+
25 from matplotlib import cbook
|
60
|
+
|
61
|
+
26 from matplotlib.cbook import ls_mapper
|
62
|
+
|
63
|
+
---> 27 from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
|
64
|
+
|
65
|
+
28 from matplotlib.colors import is_color_like
|
66
|
+
|
67
|
+
29
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
/Library/Python/3.7/site-packages/matplotlib/fontconfig_pattern.py in
|
72
|
+
|
73
|
+
16 import re
|
74
|
+
|
75
|
+
17 import numpy as np
|
76
|
+
|
77
|
+
---> 18 from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
|
78
|
+
|
79
|
+
19 ParseException, Suppress)
|
80
|
+
|
81
|
+
20
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
/Library/Python/3.7/site-packages/pyparsing.py in
|
86
|
+
|
87
|
+
5670 stringEnd = StringEnd().setName("stringEnd")
|
88
|
+
|
89
|
+
5671
|
90
|
+
|
91
|
+
-> 5672 _escapedPunc = Word(_bslash, r"[]-*.$+^?()~ ", exact=2).setParseAction(lambda s, l, t: t[0][1])
|
92
|
+
|
93
|
+
5673 _escapedHexChar = Regex(r"\0?[xX][0-9a-fA-F]+").setParseAction(lambda s, l, t: unichr(int(t[0].lstrip(r'\0x'), 16)))
|
94
|
+
|
95
|
+
5674 _escapedOctChar = Regex(r"\0[0-7]+").setParseAction(lambda s, l, t: unichr(int(t[0][1:], 8)))
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
/Library/Python/3.7/site-packages/pyparsing.py in setParseAction(self, *fns, **kwargs)
|
100
|
+
|
101
|
+
1561 if not all(callable(fn) for fn in fns):
|
102
|
+
|
103
|
+
1562 raise TypeError("parse actions must be callable")
|
104
|
+
|
105
|
+
-> 1563 self.parseAction = list(map(_trim_arity, list(fns)))
|
106
|
+
|
107
|
+
1564 self.callDuringTry = kwargs.get("callDuringTry", False)
|
108
|
+
|
109
|
+
1565 return self
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
/Library/Python/3.7/site-packages/pyparsing.py in _trim_arity(func, maxargs)
|
114
|
+
|
115
|
+
1308 # IF ANY CODE CHANGES, EVEN JUST COMMENTS OR BLANK LINES, BETWEEN THE NEXT LINE AND
|
116
|
+
|
117
|
+
1309 # THE CALL TO FUNC INSIDE WRAPPER, LINE_DIFF MUST BE MODIFIED!!!!
|
118
|
+
|
119
|
+
-> 1310 this_line = extract_stack(limit=2)[-1]
|
120
|
+
|
121
|
+
1311 pa_call_line_synth = (this_line[0], this_line[1] + LINE_DIFF)
|
122
|
+
|
123
|
+
1312
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
/Library/Python/3.7/site-packages/pyparsing.py in extract_stack(limit)
|
128
|
+
|
129
|
+
1292 # special handling for Python 3.5.0 - extra deep call stack by 1
|
130
|
+
|
131
|
+
1293 offset = -3 if system_version == (3, 5, 0) else -2
|
132
|
+
|
133
|
+
-> 1294 frame_summary = traceback.extract_stack(limit=-offset + limit - 1)[offset]
|
134
|
+
|
135
|
+
1295 return [frame_summary[:2]]
|
136
|
+
|
137
|
+
1296 def extract_tb(tb, limit=0):
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py in extract_stack(f, limit)
|
142
|
+
|
143
|
+
209 if f is None:
|
144
|
+
|
145
|
+
210 f = sys._getframe().f_back
|
146
|
+
|
147
|
+
--> 211 stack = StackSummary.extract(walk_stack(f), limit=limit)
|
148
|
+
|
149
|
+
212 stack.reverse()
|
150
|
+
|
151
|
+
213 return stack
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
/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)
|
156
|
+
|
157
|
+
361 if lookup_lines:
|
158
|
+
|
159
|
+
362 for f in result:
|
160
|
+
|
161
|
+
--> 363 f.line
|
162
|
+
|
163
|
+
364 return result
|
164
|
+
|
165
|
+
365
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/traceback.py in line(self)
|
170
|
+
|
171
|
+
283 def line(self):
|
172
|
+
|
173
|
+
284 if self._line is None:
|
174
|
+
|
175
|
+
--> 285 self._line = linecache.getline(self.filename, self.lineno).strip()
|
176
|
+
|
177
|
+
286 return self._line
|
178
|
+
|
179
|
+
287
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py in getline(filename, lineno, module_globals)
|
184
|
+
|
185
|
+
14
|
186
|
+
|
187
|
+
15 def getline(filename, lineno, module_globals=None):
|
188
|
+
|
189
|
+
---> 16 lines = getlines(filename, module_globals)
|
190
|
+
|
191
|
+
17 if 1 <= lineno <= len(lines):
|
192
|
+
|
193
|
+
18 return lines[lineno-1]
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/linecache.py in getlines(filename, module_globals)
|
198
|
+
|
199
|
+
46 try:
|
200
|
+
|
201
|
+
47 if module_globals is None:
|
202
|
+
|
203
|
+
---> 48 for mod in sys.modules.values():
|
204
|
+
|
205
|
+
49 if getattr(mod, '__file__', None) == filename:
|
206
|
+
|
207
|
+
50 module_globals = mod.__dict__
|
208
|
+
|
209
|
+
|
210
|
+
|
21
211
|
RuntimeError: dictionary changed size during iteration
|
22
212
|
|
23
213
|
```
|
1
該当するソースコードが違ったので、直しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,13 +44,7 @@
|
|
44
44
|
|
45
45
|
import numpy as np
|
46
46
|
|
47
|
-
import pickle
|
48
|
-
|
49
|
-
from random import shuffle
|
50
|
-
|
51
47
|
from scipy.misc import imread
|
52
|
-
|
53
|
-
from scipy.misc import imresize
|
54
48
|
|
55
49
|
import tensorflow as tf
|
56
50
|
|
@@ -58,89 +52,27 @@
|
|
58
52
|
|
59
53
|
from ssd import SSD300
|
60
54
|
|
61
|
-
from ssd_training import MultiboxLoss
|
62
|
-
|
63
55
|
from ssd_utils import BBoxUtility
|
64
56
|
|
65
57
|
|
66
58
|
|
67
|
-
|
59
|
+
%matplotlib inline
|
68
60
|
|
69
|
-
|
61
|
+
plt.rcParams['figure.figsize'] = (8, 8)
|
70
62
|
|
71
|
-
batch_size, path_prefix,
|
72
|
-
|
73
|
-
train_keys, val_keys, image_size,
|
74
|
-
|
75
|
-
saturation_var=0.5,
|
76
|
-
|
77
|
-
brightness_var=0.5,
|
78
|
-
|
79
|
-
contrast_var=0.5,
|
80
|
-
|
81
|
-
lighting_std=0.5,
|
82
|
-
|
83
|
-
hflip_prob=0.5,
|
84
|
-
|
85
|
-
vflip_prob=0.5,
|
86
|
-
|
87
|
-
do_crop=True,
|
88
|
-
|
89
|
-
crop_area_range=[0.75, 1.0],
|
90
|
-
|
91
|
-
|
63
|
+
plt.rcParams['image.interpolation'] = 'nearest'
|
92
|
-
|
93
|
-
self.gt = gt
|
94
|
-
|
95
|
-
self.bbox_util = bbox_util
|
96
|
-
|
97
|
-
self.batch_size = batch_size
|
98
|
-
|
99
|
-
self.path_prefix = path_prefix
|
100
|
-
|
101
|
-
self.train_keys = train_keys
|
102
|
-
|
103
|
-
self.val_keys = val_keys
|
104
|
-
|
105
|
-
self.train_batches = len(train_keys)
|
106
|
-
|
107
|
-
self.val_batches = len(val_keys)
|
108
|
-
|
109
|
-
self.image_size = image_size
|
110
|
-
|
111
|
-
self.color_jitter = []
|
112
|
-
|
113
|
-
if saturation_var:
|
114
|
-
|
115
|
-
self.saturation_var = saturation_var
|
116
|
-
|
117
|
-
self.color_jitter.append(self.saturation)
|
118
|
-
|
119
|
-
if brightness_var:
|
120
|
-
|
121
|
-
self.brightness_var = brightness_var
|
122
|
-
|
123
|
-
self.color_jitter.append(self.brightness)
|
124
|
-
|
125
|
-
if contrast_var:
|
126
|
-
|
127
|
-
self.contrast_var = contrast_var
|
128
|
-
|
129
|
-
self.color_jitter.append(self.contrast)
|
130
|
-
|
131
|
-
self.lighting_std = lighting_std
|
132
|
-
|
133
|
-
self.hflip_prob = hflip_prob
|
134
|
-
|
135
|
-
self.vflip_prob = vflip_prob
|
136
|
-
|
137
|
-
self.do_crop = do_crop
|
138
|
-
|
139
|
-
self.crop_area_range = crop_area_range
|
140
|
-
|
141
|
-
self.aspect_ratio_range = aspect_ratio_range
|
142
64
|
|
143
65
|
|
66
|
+
|
67
|
+
np.set_printoptions(suppress=True)
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
config = tf.ConfigProto()
|
72
|
+
|
73
|
+
config.gpu_options.per_process_gpu_memory_fraction = 0.45
|
74
|
+
|
75
|
+
set_session(tf.Session(config=config))
|
144
76
|
|
145
77
|
|
146
78
|
|