github地址:https://github.com/lukszamarcin/100-tiramisu-keras
该代码的测试环境为:
- Python 3.5.2
- Tensorflow 1.6.0
- Keras 2.1.5
但是,上述Python包的版本都非常老旧了,本文测试出一个能成功运行的版本:
- Python 3.6.13
- TensorFlow-GPU 1.8.0
- cudatoolkit 9.0
- cudnn 7.6.5
- keras 2.1.6
- numpy 1.16.4,若高于该版本会报错:FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
- h5py 2.10.0,若高于该版本会报错:original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
注意!!!!
若升级到TensorFlow 2.x, 已经原生自带Keras了,无需单独安装!!! 参考:https://keras.io/about/
将之前:
from keras import xxx
替换为
from tensorflow.keras.models import xxx
即可
网友评论