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

how to solve the error of AttributeError: 'Tensor' object has no attribute 'isnan' #2

Closed
xiaosa96 opened this issue Mar 15, 2021 · 3 comments
Labels
package error Error from external package

Comments

@xiaosa96
Copy link

hello,
AttributeError: 'Tensor' object has no attribute 'isnan' when I run./script.sh 0. May I ask how to solve it? My PyTorch environment is 1.5.0, TorchVision environment is 0.6.0, and MMCV version is 1.0.5

@yuantn
Copy link
Owner

yuantn commented Mar 15, 2021

hello,
AttributeError: 'Tensor' object has no attribute 'isnan' when I run./script.sh 0. May I ask how to solve it? My PyTorch environment is 1.5.0, TorchVision environment is 0.6.0, and MMCV version is 1.0.5

Hello,

I have checked the document of PyTorch 1.5.0, and there exists the function " isnan() " in this version ( https://pytorch.org/docs/1.5.0/torch.html?highlight=isnan#torch.isnan ).

I think there are two ways to solve the problem:

  1. Re-install the Pytorch and TorchVision with the instructions provided by the PyTorch official website ( https://pytorch.org/get-started/previous-versions/#v160 )
  2. Check the lines of AttributeError, and replace the " if value.isnan() " with " if value != value " ( considering that only nan != nan). I think the error may be in the Line 483 and 569 of the " ./mmdet/models/dense_heads/MIAOD_head.py ".

@xiaosa96
Copy link
Author

hello,
AttributeError: 'Tensor' object has no attribute 'isnan' when I run./script.sh 0. May I ask how to solve it? My PyTorch environment is 1.5.0, TorchVision environment is 0.6.0, and MMCV version is 1.0.5

Hello,

I have checked the document of PyTorch 1.5.0, and there exists the function " isnan() " in this version ( https://pytorch.org/docs/1.5.0/torch.html?highlight=isnan#torch.isnan ).

I think there are two ways to solve the problem:

  1. Re-install the Pytorch and TorchVision with the instructions provided by the PyTorch official website ( https://pytorch.org/get-started/previous-versions/#v160 )
  2. Check the lines of AttributeError, and replace the " if value.isnan() " with " if value != value " ( considering that only nan != nan). I think the error may be in the Line 482 and 568 of the " ./mmdet/models/dense_heads/MIAL_head.py ".

您好:
非常感谢您昨晚给我的回复,目前这个问题通过使用您给的第二个解决方法已经解决了,再次感谢您的回复,谢谢!同时祝您在新的一年多发顶会顶刊,感谢!

@yuantn
Copy link
Owner

yuantn commented Mar 16, 2021

hello,
AttributeError: 'Tensor' object has no attribute 'isnan' when I run./script.sh 0. May I ask how to solve it? My PyTorch environment is 1.5.0, TorchVision environment is 0.6.0, and MMCV version is 1.0.5

Hello,
I have checked the document of PyTorch 1.5.0, and there exists the function " isnan() " in this version ( https://pytorch.org/docs/1.5.0/torch.html?highlight=isnan#torch.isnan ).
I think there are two ways to solve the problem:

  1. Re-install the Pytorch and TorchVision with the instructions provided by the PyTorch official website ( https://pytorch.org/get-started/previous-versions/#v160 )
  2. Check the lines of AttributeError, and replace the " if value.isnan() " with " if value != value " ( considering that only nan != nan). I think the error may be in the Line 482 and 568 of the " ./mmdet/models/dense_heads/MIAL_head.py ".

您好:
非常感谢您昨晚给我的回复,目前这个问题通过使用您给的第二个解决方法已经解决了,再次感谢您的回复,谢谢!同时祝您在新的一年多发顶会顶刊,感谢!

😄

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

No branches or pull requests

2 participants