P2333/Reverse-Cross-Entropy

ValueError when runing train.py

rsindper opened this issue · 1 comments

Hi there, I got an ValueError when runing the training command instructed in the tutorial,

Traceback (most recent call last):
File "train.py", line 196, in
tf.app.run()
File "/root/anaconda3/envs/tf15/lib/python3.7/site-packages/tensorflow_core/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/root/anaconda3/envs/tf15/lib/python3.7/site-packages/absl/app.py", line 303, in run
_run_main(main, args)
File "/root/anaconda3/envs/tf15/lib/python3.7/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "train.py", line 191, in main
train(hps,hps_test)
File "train.py", line 67, in train
FLAGS.dataset, FLAGS.eval_data_path, hps_test.batch_size, 'eval')
File "/root/anaconda3/envs/tf15/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "/root/anaconda3/envs/tf15/lib/python3.7/site-packages/tensorflow_core/python/training/input.py", line 258, in string_input_producer
raise ValueError(not_null_err)
ValueError: string_input_producer requires a non-null input tensor

I put the data under fold mnist_dataset/data_train.bin

P2333 commented

Hi, I note that you use python 3.7, while our code is based on python 2.7. Could you please set up an e.g., virtualenv of python 2.7 and have a try? Sorry for the inconvenience.

You can simply install pip install virtualenv and run virtualenv --system-site-packages -p python2.7 env_py27, without installing anaconda. Besides the TensorFlow version we used is 1.9.0, different versions of TF may deprecate or change some APIs.