You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "train_cp2p.py", line 90, in<module>
train_net(cfg)
File "train_cp2p.py", line 55, in train_net
fori, datain enumerate(train_loader):
File "/home/anaconda3/envs/fm2023/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
data = self._next_data()
File "/home/anaconda3/envs/fm2023/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/anaconda3/envs/fm2023/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 46, in fetch
data = self.dataset[possibly_batched_index]
File "/home/FM_Code/dpfm/Cp2p_dataset.py", line 174, in __getitem__
P[range(evec_2.size(0)), map21.flatten()] = 1
IndexError: shape mismatch: indexing tensors could not be broadcast together with shapes [1777], [5830]
Fortunately, loding shapes and get_all_operators operations are working fine.
From the error above, I think there is a problem with the implementation of the "getitem" function
I don't know why the error occurred and hope I can get an answer from you~
Have a nice day :)
The text was updated successfully, but these errors were encountered:
To use the cp2p dataset in DPFM, I wrote two py files:
In the cp2p_dataset.py, I defined the class "Cp2pDataset" that inherits "Dataset" class, which is come from:
The specific implementation code of py is as follows:
However, I encountered the following error:
Fortunately, loding shapes and get_all_operators operations are working fine.
From the error above, I think there is a problem with the implementation of the "getitem" function
I don't know why the error occurred and hope I can get an answer from you~
Have a nice day :)
The text was updated successfully, but these errors were encountered: