tensorflow_template_application icon indicating copy to clipboard operation
tensorflow_template_application copied to clipboard

Error while running CNN

Open anujgupta82 opened this issue 7 years ago • 2 comments

I tried to the CNN using command given in README.md

       ./dense_classifier.py --train_file ./data/lung/fa7a21165ae152b13def786e6afc3edf.dcm.csv.tfrecords --validate_file ./data/lung/fa7a21165ae152b13def786e6afc3edf.dcm.csv.tfrecords --feature_size 262144 --label_size 2 --batch_size 2 --validate_batch_size 2 --epoch_number -1 --model cnn

I get the following error

File "/home/root1/.virtualenv/tensorflow_template_application/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1363, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key conv0/bias not found in checkpoint
	 [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Caused by op u'save/RestoreV2', defined at:
  File "./dense_classifier.py", line 580, in <module>
    main()
  File "./dense_classifier.py", line 438, in main
    saver = tf.train.Saver()



NotFoundError (see above for traceback): Key conv0/bias not found in checkpoint
	 [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

anujgupta82 avatar Feb 08 '18 11:02 anujgupta82

It seems that you have saved the checkpoint in other network. This script will try to load the checkpoint from the path "./checkpoint" firstly and it throws errors when you change the model network.

Please try deleting the path of "./checkpoint" and try again.

tobegit3hub avatar Feb 09 '18 08:02 tobegit3hub

The problem seems to be bit more.

I deleted the "./checkpoint" and ran the command

./dense_classifier.py --train_file ./data/lung/fa7a21165ae152b13def786e6afc3edf.dcm.csv.tfrecords --validate_file ./data/lung/fa7a21165ae152b13def786e6afc3edf.dcm.csv.tfrecords --feature_size 262144 --label_size 2 --batch_size 2 --validate_batch_size 2 --epoch_number -1 --model cnn

It worked like a charm. However, after this when I run

./dense_classifier.py 

It complains NotFoundError (see above for traceback): Key input/biases not found in checkpoint

If you delete "./checkpoint" again and run

./dense_classifier.py 

it runs smoothly, however now if you run cnn, it will complain

anujgupta82 avatar Feb 09 '18 14:02 anujgupta82