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

Issue with pytorch version #53

Closed
ibrahim-601 opened this issue Sep 23, 2021 · 2 comments
Closed

Issue with pytorch version #53

ibrahim-601 opened this issue Sep 23, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@ibrahim-601
Copy link
Contributor

ibrahim-601 commented Sep 23, 2021

I tried following the instructions on the repository. Pytorch 1.8.1 is installed with the instructions. But with that environment, the right points of lines get a little bit downward. But if I try the same with PyTorch 1.4.0 there is no issue. Can you please explain why is this happening? Or can you update the instructions for the correct PyTorch version? I have attached both outputs. The first one is with PyTorch 1.4.0 and the second one is with PyTorch 1.8.1.

PyTorch 1.4.0 sample:

table_torch_1 4 0

PyTorch 1.8.1 sample:
table_torch_1 8 1

@zhou13
Copy link
Owner

zhou13 commented Sep 23, 2021

Hi @ibrahim-601, Thank you for reporting. This is an interesting finding. Could you reproduce the result using demo.py with the pre-trained model? Could you also upload the original image in PNG so I can investigate? If you can help to debug, could you help print/plot jmap and joff at

max_K = M.n_dyn_junc // n_type
and see if they are the same in Python 1.8.1 and Python 1.4.0?

@zhou13 zhou13 added the bug Something isn't working label Sep 23, 2021
@ibrahim-601
Copy link
Contributor Author

ibrahim-601 commented Sep 24, 2021

Hi @zhou13, thank you very much for replying. The above result is produced with demo.py with the pre-trained model. I saved the jmap and joff values in a JSON file using below code

js_data = {'jmap_after_nms': jmap.cpu().numpy().tolist(), 'joff': joff.cpu().numpy().tolist()}
json.dump(js_data, open('jmap_joff.json','w'))

at

max_K = M.n_dyn_junc // n_type

The values of jmap and joff in PyTorch 1.4.0 and PyTorch 1.8.1 are the same.
I have uploaded the original image and some test results along with the JSON files here.

ibrahim-601 added a commit to ibrahim-601/lcnn that referenced this issue Sep 27, 2021
In PyTorch 1.4.x (index/128) at https://github.com/zhou13/lcnn/blob/88f281ab5421d51a62f1f84f97fea05afbf0c8d8/lcnn/models/line_vectorizer.py#L174 outputs integer values but in PyTorch 1.8.x it outputs float values. Updating it with (index//128) outputs integer values in both PyTorch versions and solves zhou13#53 (comment).
@zhou13 zhou13 closed this as completed in e07e48b Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants