运行github上的ResNet in TensorFlow注意事项

最近看了resnet,然后想运行下ResNet网络,于是在github找了ResNet TensorFlow版本的代码。但是运行的时候出现了一些小问题,在这里总结下。

我是以CIFAR-10为例子,用resnet训练分类模型模型。完整的流程是下面3个代码

  • cifar10_download_and_extract.py(下载数据集)
  • cifar10_main.py(训练模型)
  • cifar10_test.py(测试模型)

我在运行cifar10_main.py总是出现AttributeError: module ‘tensorflow’ has no attribute ‘data’这个错误,花了好长时间找到了原因:TensorFlow版本旧了,所以不支持,总是报错

解决方案:把TensorFlow更新一下。

更新TensorFlow命令

(tensorflow)$ pip install --upgrade tensorflow      # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow     # for Python 3.n

猜你喜欢

转载自blog.csdn.net/xw2017/article/details/78939994