質問編集履歴
1
コード改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,4 +12,82 @@
|
|
12
12
|
imgs.append(center_output)
|
13
13
|
|
14
14
|
return imgs
|
15
|
+
```
|
16
|
+
#エラーコード
|
17
|
+
```ここに言語を入力
|
18
|
+
Traceback (most recent call last):
|
19
|
+
|
20
|
+
File "C:\Users\Desktop\resyuu.py", line 149, in <module>
|
21
|
+
main()
|
22
|
+
|
23
|
+
File "C:\Users\Desktop\resyuu.py", line 85, in main
|
24
|
+
imgs1 = create_images_array(load_img1_paths,model,layer_name)
|
25
|
+
|
26
|
+
File "C:\Users\Desktop\resyuu.py", line 28, in create_images_array
|
27
|
+
middle_output = middle_layer_model.predict(target)
|
28
|
+
|
29
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\training.py", line 130, in _method_wrapper
|
30
|
+
return method(self, *args, **kwargs)
|
31
|
+
|
32
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1599, in predict
|
33
|
+
tmp_batch_outputs = predict_function(iterator)
|
34
|
+
|
35
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\eager\def_function.py", line 780, in __call__
|
36
|
+
result = self._call(*args, **kwds)
|
37
|
+
|
38
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\eager\def_function.py", line 823, in _call
|
39
|
+
self._initialize(args, kwds, add_initializers_to=initializers)
|
40
|
+
|
41
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\eager\def_function.py", line 697, in _initialize
|
42
|
+
*args, **kwds))
|
43
|
+
|
44
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\eager\function.py", line 2855, in _get_concrete_function_internal_garbage_collected
|
45
|
+
graph_function, _, _ = self._maybe_define_function(args, kwargs)
|
46
|
+
|
47
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\eager\function.py", line 3213, in _maybe_define_function
|
48
|
+
graph_function = self._create_graph_function(args, kwargs)
|
49
|
+
|
50
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\eager\function.py", line 3075, in _create_graph_function
|
51
|
+
capture_by_value=self._capture_by_value),
|
52
|
+
|
53
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\framework\func_graph.py", line 986, in func_graph_from_py_func
|
54
|
+
func_outputs = python_func(*func_args, **func_kwargs)
|
55
|
+
|
56
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\eager\def_function.py", line 600, in wrapped_fn
|
57
|
+
return weak_wrapped_fn().__wrapped__(*args, **kwds)
|
58
|
+
|
59
|
+
File "C:\anaconda\lib\site-packages\tensorflow\python\framework\func_graph.py", line 973, in wrapper
|
60
|
+
raise e.ag_error_metadata.to_exception(e)
|
61
|
+
|
62
|
+
ValueError: in user code:
|
63
|
+
|
64
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\training.py:1462 predict_function *
|
65
|
+
return step_function(self, iterator)
|
66
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\training.py:1452 step_function **
|
67
|
+
outputs = model.distribute_strategy.run(run_step, args=(data,))
|
68
|
+
C:\anaconda\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:1211 run
|
69
|
+
return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
|
70
|
+
C:\anaconda\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:2585 call_for_each_replica
|
71
|
+
return self._call_for_each_replica(fn, args, kwargs)
|
72
|
+
C:\anaconda\lib\site-packages\tensorflow\python\distribute\distribute_lib.py:2945 _call_for_each_replica
|
73
|
+
return fn(*args, **kwargs)
|
74
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\training.py:1445 run_step **
|
75
|
+
outputs = model.predict_step(data)
|
76
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\training.py:1418 predict_step
|
77
|
+
return self(x, training=False)
|
78
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\base_layer.py:985 __call__
|
79
|
+
outputs = call_fn(inputs, *args, **kwargs)
|
80
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\functional.py:386 call
|
81
|
+
inputs, training=training, mask=mask)
|
82
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\functional.py:508 _run_internal_graph
|
83
|
+
outputs = node.layer(*args, **kwargs)
|
84
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\base_layer.py:976 __call__
|
85
|
+
self.name)
|
86
|
+
C:\anaconda\lib\site-packages\tensorflow\python\keras\engine\input_spec.py:180 assert_input_compatibility
|
87
|
+
str(x.shape.as_list()))
|
88
|
+
|
89
|
+
ValueError: Input 0 of layer conv1_pad is incompatible with the layer: expected ndim=4, found ndim=3. Full shape received: [32, 224, 3]
|
90
|
+
|
91
|
+
|
92
|
+
|
15
93
|
```
|