我正在尝试复现Deep-shopping模型的结果,但当我运行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中都存在。
我的问题是:
如何解决这个问题?
python -c 'import tensorflow as tf; print(tf.__version__)'
。 - Engineero