No model_checkpoint_path error when copy_task.py --mode test
softgearko opened this issue · comments
I got an error when I run copy_task.py --mode test.
First, I learn NTM with this command
python3 copy_task.py --rnn_num_layers 3 --rnn_size 64 --max_seq_length 10 --memory_size 20 --memory_vector_dim 8 --vector_dim 4 --num_epoches 10000
Next, I run copy_task.py with test mode. But I got the following error ; AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path'
$ python3 copy_task.py --mode test
2018-01-19 18:51:24.433505: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-01-19 18:51:24.581123: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-01-19 18:51:24.581508: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: TITAN X (Pascal) major: 6 minor: 1 memoryClockRate(GHz): 1.531
pciBusID: 0000:01:00.0
totalMemory: 11.90GiB freeMemory: 11.76GiB
2018-01-19 18:51:24.581522: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:01:00.0, compute capability: 6.1)
Traceback (most recent call last):
File "copy_task.py", line 101, in
main()
File "copy_task.py", line 31, in main
test(args)
File "copy_task.py", line 85, in test
saver.restore(sess, ckpt.model_checkpoint_path)
AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path'
$
I modified one line to fix the problem , then it works.
def test(args):
model = NTMCopyModel(args, args.test_seq_length)
saver = tf.train.Saver()
# ckpt = tf.train.get_checkpoint_state(args.save_dir)
ckpt = tf.train.get_checkpoint_state(args.save_dir + '/' + args.model)