A bug……
227BaronChen opened this issue · comments
When I test the example code of usage, there is a "RuntimeError", it says "input value can be a scalar only when boundaries tensor dimension is 1, but we got boundaries tensor dim(4) and input value's dim(0) numel(1).", which confuses me.
Does anyone have a similar problem, if anyone can help me, I would be very grateful.
Will solve it in approx an hour
Nice! I'd appreciate that.
Will solve it in approx an hour
Good, so a PR is on its way to be accepted. In the meantime, you can access the code at this fork: https://github.com/hypnopump/alphafold2 OR try the mean
option for mds instead of the deafult median
one. To do so, replace the line n25 in your file by:
distances, _, weights = center_distogram_torch(distogram, center="mean")
Hope this solves your issue. if you'd like to contribute to the development, you can join us in the /alphafold
channel here: https://discord.gg/BddkRME
Maybe, the line n150 of the utils module needs to add ".cuda()" to ensure that all data is loaded in the GPU. But when I was testing, no matter whether the " center='mean' "was added or not, the error was always "RuntimeError: CUDA error: device-side assert triggered".
Good, so a PR is on its way to be accepted. In the meantime, you can access the code at this fork: https://github.com/hypnopump/alphafold2 OR try the
mean
option for mds instead of the deafultmedian
one. To do so, replace the line n25 in your file by:distances, _, weights = center_distogram_torch(distogram, center="mean")Hope this solves your issue. if you'd like to contribute to the development, you can join us in the
/alphafold
channel here: https://discord.gg/BddkRME
may you try now? on the forked repo. the idea was tested on cpu, but i think it should work now. there's always the mean
alternative
Thank you for your prompt reply, but there is still a little problem, and I believe it will be solved soon.
distances, _, weights = center_distogram_torch(distogram)
:
distances, _, weights = center_distogram_torch(distogram, center="mean")
:
may you try now? on the forked repo. the idea was tested on cpu, but i think it should work now. there's always the
mean
alternative
At the same time, may you add comments to this forked repo, people need to remove the ".cuda()" in the usage (if they want to test it on cpu).
should be working now
wrt to the comments: This project is in active development so it's not a final version. However, running on CPU is not advised. It will take too much time and even with multicore execution, it's not feasable (for reference, the mds step alone might take approx 1-10 minuts per protein, depending on the size and the number of mirrors per protein).
I'll set up a general device naming in the next PR
wrt to the mean
issue: there was a mistake saying that center_distogram_torch
supported batched inputs (batch, N, N, B). It does not. Make sure you pass a tensor with shape (N, N, B)
It seems that there is still an index problem.
error trace?
should be solved
This function has been tested in /tests/structure_utils_tests.ipynb
. Check you're passing the arguments in the same way
Okay, thank you for your patient guidance.