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

RuntimeError: The size of tensor a (1204) must match the size of tensor b (1201) at non-singleton dimension 2 #2

Open
Liampour opened this issue Nov 25, 2024 · 0 comments

Comments

@Liampour
Copy link

Hello, I trained a model and I saved it with the name model2.pth but when I try to evaluate the results for an inputted .png image (with dimensions (1201x1159)) the following error appears

Traceback (most recent call last):
  File "colorize.py", line 188, in <module>
    main()
  File "colorize.py", line 184, in main
    evaluate(args)
  File "colorize.py", line 138, in evaluate
    utils.save_image_preserv_length(rec_img[0], img[0], save_path)
  File "/home/username/White-Balance-By-Deep-learning/utils.py", line 50, in save_image_preserv_length
    tensor = tensor * orilen
RuntimeError: The size of tensor a (1204) must match the size of tensor b (1201) at non-singleton dimension 2

The command that I used for the evaluation is the following
python3 colorize.py eval --input-dir input --output-dir output --model model/model2.pth

Any suggestions??

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

1 participant