Closed Jiram-Kin closed 2 years ago
Hi Jiram-Kin,
I am glad you’re enjoying the package. Thanks for bringing this issue to my attention, and I apologize for the inconvenience! Can you provide me with a screenshot or text containing the complete error message? I want to be sure to make the right change to the code.
Thank you. On Nov 21, 2021, 3:12 AM +0100, Jiram-Kin @.***>, wrote:
Thanks for the awesome package, I am trying to use a custom dataset for training my model, however I found out that the create custom function is returning error 'Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead'. I saw that you added detach to some code recently so I wonder if you could do the same for other functionality as well Thank you so much — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
This is the screenshot, for full error message it is the following
RemoteTraceback Traceback (most recent call last) RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.7/multiprocessing/pool.py", line 121, in worker result = (True, func(*args, **kwds)) File "/usr/local/lib/python3.7/dist-packages/sidechainnet/utils/download.py", line 246, in process_id dihedrals_coords_sequence = get_seq_coords_and_angles(chain) File "/usr/local/lib/python3.7/dist-packages/sidechainnet/utils/measure.py", line 231, in get_seq_coords_and_angles prev_ang) File "/usr/local/lib/python3.7/dist-packages/sidechainnet/utils/measure.py", line 290, in standardize_residue new_res = rb.to_prody(res) File "/usr/local/lib/python3.7/dist-packages/sidechainnet/structure/StructureBuilder.py", line 441, in to_prody ag.setCoords(torch.stack(self.bb + self.sc).numpy()) RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead. """
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
Thank you. The problem was that I had made the fix in GitHub, but did not publish a new version (v0.7.4
) via pip
. Now the Colab notebook (or any other pip
-installed version of sidechainnet) should work!
Thank you, the create_custom function is working properly now!
Thanks for the awesome package, I am trying to use a custom dataset for training my model, however I found out that the create custom function is returning error 'Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead'. I saw that you added detach to some code recently so I wonder if you could do the same for other functionality as well
Thank you so much