cchallu / spectranet

Apache License 2.0
23 stars 7 forks source link

Single Line Colab error. Potential bug? #4

Open pauljones0 opened 1 year ago

pauljones0 commented 1 year ago

Hi, I figured I'd give a shot at running your 'default' code on my laptop, but only running on 2 CPUs has taken 3 days now and counting.

So I shifted the code to Colab, but experienced issues when trying to speed up the code using a GPU.

I got the following error: File "/content/spectranet/src/models/spectranet.py", line 183, in _load_current_chain p_0_z = self.p_0_chains[idxs].to(idxs.device) RuntimeError: indices should be either on CPU or on the same device as the indexed tensor (CPU)

From my digging online, there needs to be some specification added to this line to make it work, as right now, PyTorch seems to be making assumptions about where the allocated resources are located.

The problem is I don't know enough about pytorch to know what the code change needs to be.

cchallu commented 1 year ago

Hi @pauljones0. The code is designed to work on GPU. In CPU it will take a lot of time, so I don't recommend it. I was able to run the current code in a GPU without any errors. Are you using the Github code directly or did you copy everything in Colab? I will wrap up the code so it can be pip installed directly from Colab.

pauljones0 commented 1 year ago

I ran the minimal code I figured was necessary to get the code running with both a standard/premium GPU and neither worked

https://colab.research.google.com/drive/1nIbe5jAB2RpNSDYEmd3cJxzbgOfBZ_iO?usp=sharing

I assume the code ran smoothly with a local Colab instance?