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

Errors when using the loss function #3

Closed
berlino opened this issue Aug 18, 2019 · 9 comments
Closed

Errors when using the loss function #3

berlino opened this issue Aug 18, 2019 · 9 comments

Comments

@berlino
Copy link

berlino commented Aug 18, 2019

The error shows that when computing the loss, the size of 'target' is not the same as 'p_star'. https://github.com/deep-spin/entmax/blob/master/entmax/losses.py#L156 Should it be switch to index_add_? Any hint?

Pytorch version: '0.4.1.post2'

Thanks

@bpopeters
Copy link
Collaborator

Thank you for opening the issue. I'm having trouble replicating this but it sounds like a mismatch in between the dimensions of the input and the target. Could you provide an example that causes this bug?

P.S. This probably won't have any effect on the bug, but that version of pytorch is rather out of date.

@berlino
Copy link
Author

berlino commented Aug 19, 2019

Thanks.
After I switch to the most recent version, the error disappears. Seems like the function scatter_add_ has been updated.

@berlino berlino closed this as completed Aug 19, 2019
@vene
Copy link
Contributor

vene commented Aug 19, 2019

@berlino you mean the most recent pytorch version?

We should try to bisect pytorch versions and figure out our minimum requirement, to list in readme. Reopening this until we figure it out.

@vene vene reopened this Aug 19, 2019
@vene
Copy link
Contributor

vene commented Aug 19, 2019

(I suspect pytorch 1.0 is the minimum)

@vene
Copy link
Contributor

vene commented Aug 19, 2019

Indeed it works with 1.0.1 which is supposed to be a minor bugfix release over 1.0, and 0.4.1 is the last release before the 1.0 line, so I will go ahead and specify pytorch>=1.0 in the requirements.

@vene vene closed this as completed Aug 19, 2019
@vene
Copy link
Contributor

vene commented Aug 22, 2019

Sorry to ping you again @berlino,

We added a bunch of new features to the code and we're planning to make a package release on pypi soon, would you mind checking that your application works well with the current version of the code?

Some defaults were changed (dim=-1 now everywhere) and the import paths are now shorter (from entmax import sparsemax for instance.)

@berlino
Copy link
Author

berlino commented Aug 23, 2019

No worries.

The updated version works well for my application. (I actually made similar changes when I used the code)

@vene
Copy link
Contributor

vene commented Aug 23, 2019

Thanks a lot! We will make a pypi release soon.

@berlino
Copy link
Author

berlino commented Oct 3, 2019

@vene Following this thread, I think pytorch should be specified as a dependency in the setup.py, assuming the environment does not have pytorch installed.

Currently, I ran into the problem "ModuleNotFoundError: No module named 'torch'" when I specify entmax as a dependency in my our own setup.py.

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

3 participants