Closed hkhatod closed 7 years ago
Here is the error message I get on the train.py file
Traceback (most recent call last):
File "train.py", line 161, in
i got same problem, too
Same issue here, anyone have any fresh ideas? In another issue mentioned below it was suggested to change the saver to use the V1 format, but that didn't seem to help me:
saver = tf.train.Saver(tf.all_variables(), write_version=tf.train.SaverDef.V1)
I got it to work. You need to do two things: Step 1. Update the files to newer version using these instructions: https://www.tensorflow.org/install/migration
Step 2: I used the "last_checkpoints" restore method as described here: https://www.tensorflow.org/api_docs/python/tf/train/Saver
That seem to have done the trick for me.
Mind throwing up the source somewhere after you made these changes? tf_upgrade.py isn't being kind to me: ImportError: No module named 'tensorflow.tools'
Seems to be an issue like this for me for why I can't use the upgrade myself: ImportError: No module named 'tensorflow.tools'
Try download the files from this repo locally and place them in the same folder as your files .
That should work hopfully
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/compatibility
Forked.
Here is the updated repo that works with 1.2 https://github.com/hkhatod/multi-class-text-classification-cnn-rnn.
One caveat. Right now I have hardcoded line 111 in predict.py:
checkpoint_file = trained_dir + 'model-2200.meta'
Just use the last model name from checkpoint file that you will generate after you are done with training.
Thanks, it was still very picky about the training sample size I used, but I got it working with your code. Helped a ton!
@hkhatod Thanks, it helps a lot. But it still has some problem.
@hkhatod I have just fixed two problem in training parameters saving in train.py and model loading in predict.py. This is the pull request: https://github.com/hkhatod/multi-class-text-classification-cnn-rnn/pull/1
my repository: https://github.com/HarryHa/multi-class-text-classification-cnn-rnn
I have the same problem when apply I use my dataset!! please, have any one solved this issue?
I believe the file train.py and line#151 :
os.rename(path, trained_dir + 'best_model.ckpt')
needs to be updated for 1.2. The path variable is missing the extension of the file ? not sure. Is the any other way to fix it ?AND
predict.py line 109,110, and 111 needs to be updated as well.
checkpoint_file
= trained_dir + 'best_model.ckpt'