当前位置:网站首页>Keras to tf Vgg19 input in keras_ shape
Keras to tf Vgg19 input in keras_ shape
2022-06-29 09:14:00 【Duanmucheng】
Use tf.keras An error was reported . from keras Change to tf It appears that
Conclusion :shape Too big , The input requirements are not met
to update :nice! Try it later This
Traceback (most recent call last):
File "srgan.py", line 406, in <module>
gan = SRGAN()
File "srgan.py", line 63, in __init__
self.vgg = self.build_vgg()
File "srgan.py", line 150, in build_vgg
img_features = vgg(img)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 922, in __call__
outputs = call_fn(cast_inputs, *args, **kwargs)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\network.py", line 719, in call
convert_kwargs_to_constants=base_layer_utils.call_context().saving)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\network.py", line 888, in _run_internal_graph
output_tensors = layer(computed_tensors, **kwargs)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 886, in __call__
self.name)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\input_spec.py", line 216, in assert_input_compatibility
' but received input with shape ' + str(shape))
ValueError: Input 0 of layer fc1 is incompatible with the layer: expected axis -1 of input shape to have value 25088 but received input with shape [None, 32768]
Checked img Of shape( relevant blog), Two references shape Agreement .
Check both applications api Is there a difference :
tensorflow Inside input_shape[224.224.3]
keras Inside input_shape:299*299
Code testing img Of shape by 256,256,3
warning It also shows
WARNING:tensorflow:Model was constructed with shape (None, 224, 224, 3) for input Tensor("input_1:0", shape=(None, 224, 224, 3), dtype=float32), but it was called on an input with incompatible shape (None, 256, 256, 3).
Change a little shape
- New mistakes , Lower tensorflow Version is 1 Does not appear after
X_test.shape:(None, 224, 224, 3)
X_test[num].shape:(224, 224, 3)
Traceback (most recent call last):
File "srgan.py", line 404, in <module>
gan = SRGAN()
File "srgan.py", line 63, in __init__
self.vgg = self.build_vgg()
File "srgan.py", line 148, in build_vgg
img_features = vgg(img)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 922, in __call__
outputs = call_fn(cast_inputs, *args, **kwargs)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\network.py", line 719, in call
convert_kwargs_to_constants=base_layer_utils.call_context().saving)
File "C:\python3_7\lib\site-packages\tensorflow\python\keras\engine\network.py", line 900, in _run_internal_graph
tensor = tensor_dict[str(id(x))].pop()
IndexError: pop from empty list
- I can't get around it , use gpu Training has this problem (?)
Add link description
边栏推荐
猜你喜欢
Development tips - Image Resource Management

MT yolov6 training and testing

超融合架构和传统架构有什么区别?

2022年7月系统集成项目管理工程师认证招生简章

Augfpn: amélioration de l'apprentissage des caractéristiques à plusieurs échelles pour la détection des cibles

来个小总结吧
Working for many years, recalling life -- three years in high school

H5软键盘问题

Let's make a summary

Unity C # e-learning (12) -- protobuf generation protocol
随机推荐
Scenario analysis of deadlock during MySQL insert
今年的网络安全“体检”你做了吗?
微信小程序判断url的文件格式
js轮播图观后重做(较长的完整版,可运行)
两阶段目标检测原理详细版
Debug H5 page -vconsole
Verilog equivalent operator
记微信小程序setData动态修改字段名
微信小程序子组件向页面传值(父子组件间的通信)带源码
CDGA|交通行业做好数字化转型的核心是什么?
MT yolov6 training and testing
Leetcode (142) - circular linked list II
乘法器设计(流水线)verilog code
Augfpn: improved multiscale feature learning for target detection
工厂模式
What exactly does Devops mean?
Working for many years, recalling life -- three years in high school
uni-app获取当前页面路由url
Verilog 大小端以及 +:使用
YOLO Nano:一种高度紧凑的只看一次的卷积神经网络用于目标检测