【发布时间】:2017-10-17 16:15:54
【问题描述】:
我正在尝试重现Deep-shopping model 的结果,但是当我运行train_n_test.py 文件时,出现以下错误:
AttributeError Traceback (most recent call last)
<ipython-input-1-754aa36f8c5c> in <module>()
8 import time
9 from datetime import datetime
---> 10 from simple_resnet import *
11 from hyper_parameters import *
12
~/deep-shopping/simple_resnet.py in <module>()
6 '''
7 import numpy as np
----> 8 from hyper_parameters import *
9
10 #import tensorflow as tf
~/deep-shopping/hyper_parameters.py in <module>()
31
32 ## Hyper-parameters about the model
---> 33 tf.app.flags.DEFINE_int('num_residual_blocks', 5, '''number of residual blocks in ResNet''')
34
35
AttributeError: module 'tensorflow.python.platform.flags' has no attribute 'DEFINE_int'
我发现 python2.7 和 python3.5 都有这个错误
我的问题:
如何解决这个错误?
【问题讨论】:
-
您使用的是什么版本的 TensorFlow?从命令行尝试
python -c 'import tensorflow as tf; print(tf.__version__)'。 -
@Engineero: tensforflow 1.3.0
标签: python-3.x tensorflow deep-learning