ahmedbesbes / character-based-cnn

Implementation of character based convolutional neural network
MIT License
258 stars 55 forks source link

Predict error #8

Open thyngontran opened 3 years ago

thyngontran commented 3 years ago

Raw output on console.

python3 predict.py --model=./models/model__epoch_9_maxlen_150_lr_0.00125_loss_0.6931_acc_0.5005_f1_0.4944.pth --text="thisisatest_______" --alphabet=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_ Traceback (most recent call last): File "/Users/ttran/Desktop/development/python/character-based-cnn/predict.py", line 48, in <module> prediction = predict(args) File "/Users/ttran/Desktop/development/python/character-based-cnn/predict.py", line 11, in predict model = CharacterLevelCNN(args, args.number_of_classes) File "/Users/ttran/Desktop/development/python/character-based-cnn/src/model.py", line 12, in __init__ self.dropout_input = nn.Dropout2d(args.dropout_input) AttributeError: 'Namespace' object has no attribute 'dropout_input'

What is --number_of_classes argument? I don't have that set in the run command.

thyngontran commented 3 years ago

found resolution to my own issue.

add the following line to the predict.py file

parser.add_argument("--dropout_input", type=float, default=0.1)