jiegzhan / multi-class-text-classification-cnn-rnn

Classify Kaggle San Francisco Crime Description into 39 classes. Build the model with CNN, RNN (GRU and LSTM) and Word Embeddings on Tensorflow.
https://www.kaggle.com/c/sf-crime/data
Apache License 2.0
599 stars 262 forks source link

os.rename can not found model-2600 #26

Open aloyschen opened 7 years ago

aloyschen commented 7 years ago

I didn't change any file Traceback (most recent call last): File "train.py", line 161, in train_cnn_rnn() File "train.py", line 151, in train_cnn_rnn os.rename(path, trained_dir + 'best_model.ckpt') FileNotFoundError: [Errno 2] No such file or directory: './checkpoints_1504000981/model-2600' -> './trained_results_1504000981/best_model.ckpt'

aloyschen commented 7 years ago

I have changed the code as follow, delete the rename: logging.critical('Training is complete, testing the best model on x_test and y_test') saver.save(sess, trained_dir + 'best_model.ckpt') saver.restore(sess, checkpoint_prefix + '-' + str(best_at_step))