Closed raymondsim closed 1 year ago
can you share something for me to reproduce this error? e.g., a sample of the npy for example.
My current best guess would be that after
ctm.load("/home/username/saved_topic_model/", 49)
the weights are not on cuda and so you might need to manually do something like ctm.model.to("device")
Hi,
Update: I trained CTM on CPU and load it in GPU, that's why it causes this problem. The way I solve it is changing "USE_CUDA" and "device" to true and "cuda" respectively in the for loop here
Update: This is caused by the same problem, trained and tested on different machine. The num_data_loader_workers
was set to 80 because mp.cpu_count
was 80 on my previous device. I modified code here such that if k == "num_data_loader_workers": v = mp.cpu_count()
Thanks a lot!
Description
I was trying to used a trained combined CTM and topic model data preparation saved using pickle as suggested. I have two GPUs and one CPU.
I checked that model and is loaded into GPU (in ctm.py). I also checked that X_bow and X_contextual are loaded into GPU as well (in get_doc_topic_distribution() in ctm.py)
However, I am getting the following error, saying that at least two devices were found. Is there any pointers to resolve this solutions? Is it because I have two GPUs?
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat1 in method wrapper_addmm)
Thanks in advance!
What I Did