当前位置:网站首页>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
边栏推荐
猜你喜欢

2022年7月(软考高级)信息系统项目管理师认证招生简章

微信小程序自定义多项选择器

闭关修炼(二十一)Servlet生命周期、service方法源码分析、线程安全问题

什么是超融合?与传统架构有什么区别?.

Cdga | what is the core of digital transformation in the transportation industry?

Open3d farthest point sampling (FPS)
Working for many years, recalling life -- three years in high school

laravel 8 实现 订单表按月份水平分表

MT yolov6 training and testing

Scenario analysis of deadlock during MySQL insert
随机推荐
GPU训练云平台记录
Augfpn: amélioration de l'apprentissage des caractéristiques à plusieurs échelles pour la détection des cibles
今年的网络安全“体检”你做了吗?
ServerApp.iopub
Verilog size and +: Using
Verilog shift operator
Let's make a summary
闭关修炼(二十一)Servlet生命周期、service方法源码分析、线程安全问题
Heavyweight released "FISCO bcos application landing guide"
什么是超融合?与传统架构有什么区别?.
【To .NET】C#数据模型,从Entity Framework Core到LINQ
verilog 等价操作符
Backpack Lecture 9 - detailed understanding and code implementation
两阶段目标检测原理详细版
Handwritten virtualdom
15 things to learn in a year of internship in famous enterprises, so you can avoid detours.
乘法器设计(流水线)verilog code
PointNet/Pointnet++训练及测试
[target detection] | indicator a probabilistic challenge for object detection
train_on_batch保存一下loss函数变化的图像