问题:
在win10高配置电脑上开发好项目,准备迁移到低配置的win7的设备上去用,发现了一些问题:
Layer before convolutional layer must output image.: No error
DLL load failed: 页面文件太小,无法完成操作
Failed to load the native TensorFlow runtime
No module named tensorflow_core
问题解决:
Layer before convolutional layer must output image.: No error
DLL load failed:: 页面文件太小,无法完成操作
Failed to load the native TensorFlow runtime
网上看了很多这些问题的解决方案,但是都没能解决,原因是TensorFlow版本的冲突,后面把TensorFlow的版本更新了一下就好了
No module named tensorflow_core
这个问题后面出现了,原因也和网上其他的不同
上面那个博主的回答没能解决,但是思路启发了我,我win7是没有gpu的,但是我用的是TensorFlow的GPU版本去导包导库的,win上要用CPU版本,
所以:
from tensorflow_core.python.keras.applications.vgg16 import VGG16
from tensorflow_core.python.keras.applications.vgg16 import preprocess_input as preprocess_input_vgg
from tensorflow_core.python.keras.preprocessing import image
去掉_core改成:
from tensorflow.python.keras.applications.vgg16 import VGG16
from tensorflow.python.keras.applications.vgg16 import preprocess_input as preprocess_input_vgg
from tensorflow.python.keras.preprocessing import image
然后如果还报错,可能就是TensorFlow和Keras版本的对应问题,后面我把两个框架的版本对应起来就解决问题了。
先 pip list
查看你两个框架的版本还有一些依赖包是否能够对应,然后查询对应上的版本再去pip安装就好了。