da03 / Attention-OCR

Visual Attention based OCR
MIT License
1.11k stars 362 forks source link

difference result in difference running test #100

Open hamhochoi opened 5 years ago

hamhochoi commented 5 years ago

More specific, I trained the model with my custom dataset and saved the weight. But when it's load the weight and predict on the same image, the difference result after each time I run. I think it should have some random factor in here but I can't find any? So can you explain that?

command: python3 src/launcher.py --phase=test --visualize --data-path=data/test_1/test.txt --data-base-dir=./ --log-path=log.txt --load-model --model-dir=train/ --output-dir=results

cuongpd58 commented 5 years ago

You have to change this line of code in model.py line 133: cnn_model = CNN(self.img_data, True) to cnn_model = CNN(self.img_data, not self.forward only) Batch norm is the cause of this problem.