Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run the code #16

Open
KorneliaBastin opened this issue Jan 13, 2022 · 2 comments
Open

Unable to run the code #16

KorneliaBastin opened this issue Jan 13, 2022 · 2 comments

Comments

@KorneliaBastin
Copy link

Hi,

I am trying to run the code using already train models on one of the available images. I basically just want to test how it works.

I am in cnn-number-detection folder and I run python3 Tester/test_model.py -h and get the following error:

from Tester.tester import Tester
ModuleNotFoundError: No module named 'Tester'

I am not sure what and how to change, the dependencies look ok so I have no idea what is wrong. Could you please help?

@FabianGroeger96
Copy link
Owner

The imports in the project are done by importing them as modules. Thus you have to start all scripts with the respective flag -m from python as follows: python3 -m Tester.test_model -h

@KorneliaBastin
Copy link
Author

Thank you!

I seem to have the code working now. But I encounter few more issues. When I run the code on picture without numbers I get:

Total params: 57,482
Trainable params: 57,482
Non-trainable params: 0


2022-01-13 15:35:07,428 - Tester - INFO - [Prediction] type: info, category: -1 (100.00%)
: cannot connect to X server

Which seems fine, category is -1 so no digit detected, but when I run it on the picture with digits I get:

Total params: 57,482
Trainable params: 57,482
Non-trainable params: 0


and thats it! What is the detected digit? There is no prediction displayed anywhere....

Also another thing is I tried to run the code on my image and I get the error message as below:

Total params: 57,482
Trainable params: 57,482
Non-trainable params: 0


Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/cnn-number-detection/Tester/test_model.py", line 57, in
main()
File "/content/cnn-number-detection/Tester/test_model.py", line 37, in main
tester.test_model_with_image(args.test_image)
File "/content/cnn-number-detection/Tester/tester.py", line 25, in test_model_with_image
regions_of_interest = self.isolator.get_regions_of_interest(image_array)
File "/content/cnn-number-detection/Isolator/isolator.py", line 25, in get_regions_of_interest
cropped_images = self.__crop(image)
File "/content/cnn-number-detection/Isolator/isolator.py", line 78, in __crop
info_start = self.CONSTANTS.CROP_INFO_HEIGHT_START
AttributeError: 'NoneType' object has no attribute 'CROP_INFO_HEIGHT_START'

Not sure how I can give my image those attributes

Could you please advice?

Thanks,
Kornelia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants