c语言sscanf函数的用法是什么
454
2022-08-26
StopIteration: 'PngImageFile' object is not subscriptable
我的环境是ubuntu 16.04, keras 2.1.5,然后在运行vgg代码的时候,出现了如下的错误:
Traceback (most recent call last): File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/utils/data_utils.py", line 578, in get inputs = self.queue.get(block=True).get() File "/home/eric/anaconda3/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value File "/home/eric/anaconda3/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/utils/data_utils.py", line 401, in get_index return _SHARED_SEQUENCES[uid][i] File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/preprocessing/image.py", line 825, in __getitem__ return self._get_batches_of_transformed_samples(index_array) File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/preprocessing/image.py", line 1233, in _get_batches_of_transformed_samples img = self.image_data_generator.preprocessing_function(img) File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/applications/imagenet_utils.py", line 178, in preprocess_input mode=mode) File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/applications/imagenet_utils.py", line 132, in _preprocess_symbolic_input x = x[..., ::-1]TypeError: 'PngImageFile' object is not subscriptableThe above exception was the direct cause of the following exception:Traceback (most recent call last): File "vgg16_finetune.py", line 340, in
解决方法
查资料发现这是keras 2.1.5的bug,我的做法是回滚:
pip install keras==2.1.4
参考文献
[1].新版Keras版本2.1.5不兼容.https://zhuanlan.zhihu.com/p/35146669
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~