micronet icon indicating copy to clipboard operation
micronet copied to clipboard

There was a warning during training. I don't know why

Open DamonYangyang opened this issue 3 years ago • 4 comments

UserWarning: The given NumPy array is not writeable, and PyTorch does not support non-writeable tensors. This means you can write to the underlying (supposedly non-writeable) NumPy array using the tensor. You may want to copy the array to protect its data or make it writeable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:141.)

DamonYangyang avatar Sep 17 '21 07:09 DamonYangyang

Thanks for letting me know the warning. I think it does not influence the implementation of the other codes. Since I cannot produce the warning on my side, could you let me know which part of the code caused it?

liyunsheng13 avatar Sep 18 '21 04:09 liyunsheng13

Thanks for letting me know the warning. I think it does not influence the implementation of the other codes. Since I cannot produce the warning on my side, could you let me know which part of the code caused it?

In the dataloaders.py module on lines 27 and 32, which is the "torch.from_numpy" in the fast_collate function, the tens variable in the other 27 lines seems to be useless. I don’t know if it’s the torch version. My torch is 1.6 . Of course, this warning does not affect the operation of the program

DamonYangyang avatar Sep 18 '21 04:09 DamonYangyang

I think it is probably caused by the mismatch of Pytorch version since I cannot reproduce this warning on my side. Thanks for letting me know.

liyunsheng13 avatar Sep 29 '21 17:09 liyunsheng13

I got the warning, too. And the program was killed then. I want to train the model on my own dataset, so I put my data under .\data. But there are some mistakes. Can you help me, plz. image My environment: CUDA 10.2 Python 3.6 torch 1.8

wisper181 avatar Jul 29 '22 01:07 wisper181