multi-class-text-classification-cnn icon indicating copy to clipboard operation
multi-class-text-classification-cnn copied to clipboard

UnboundLocalError: local variable 'path' referenced before assignment

Open arisagithub opened this issue 8 years ago • 2 comments

Hello, i have a dataset with 1572 sentences and 13 classes. i try to train this data. here is output and error: INFO:root:The maximum length of all sentences: 40 INFe O:root:x_train: 1271, x_dev: 142, x_test: 158 INFO:root:y_train: 1271, y_dev: 142, y_test: 158 Traceback (most recent call last): File "train.py", line 136, in train_cnn() File "train.py", line 131, in train_cnn logging.critical('Accuracy on test set is {} based on the best model {}'.format(test_accuracy, path)) UnboundLocalError: local variable 'path' referenced before assignment.

arisagithub avatar Apr 05 '17 17:04 arisagithub

"evaluate_every": 200

Your training dataset is quite small. Try a small "evaluate_every" number such as 2? or 4?

jiegzhan avatar Apr 07 '17 00:04 jiegzhan

Thanks.

arisagithub avatar Apr 09 '17 12:04 arisagithub