Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Making a prediction on CPU after training on GPU #89

Open
pthavarasa opened this issue Aug 15, 2022 · 0 comments
Open

[Bug] Making a prediction on CPU after training on GPU #89

pthavarasa opened this issue Aug 15, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@pthavarasa
Copy link

pthavarasa commented Aug 15, 2022

Describe the bug

Making a prediction on CPU after training on GPU, getting running time error.

To Reproduce

Train UIS-RNN on GPU
Predict on CPU only machine

Commands and arguments

Default arguments.

Logs

Traceback (most recent call last):
  File ".\speakerDiarization.py", line 207, in <module>
    main(r'wavs/rmdmy.wav', embedding_per_second=1.2, overlap_rate=0.4)
  File ".\speakerDiarization.py", line 158, in main
    uisrnnModel.load(SAVED_MODEL_NAME)
  File "C:\Users\Prasanth\Desktop\VScode\stage\Speaker-Diarization\uisrnn\uisrnn.py", line 151, in load
    var_dict = torch.load(filepath)
  File "C:\Users\Prasanth\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 607, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "C:\Users\Prasanth\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 882, in _load
    result = unpickler.load()
  File "C:\Users\Prasanth\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 857, in persistent_load
    load_tensor(data_type, size, key, _maybe_decode_ascii(location))
  File "C:\Users\Prasanth\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 846, in load_tensor
    loaded_storages[key] = restore_location(storage, location)
  File "C:\Users\Prasanth\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 175, in default_restore_location
    result = fn(storage, location)
  File "C:\Users\Prasanth\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 151, in _cuda_deserialize
    device = validate_cuda_device(location)
  File "C:\Users\Prasanth\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 135, in validate_cuda_device
    raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

Versions

  • uis-rnn git HEAD: 0.1.0
  • numpy: 1.18.5
  • scipy: 1.7.3
  • torch: 1.10.2
@pthavarasa pthavarasa added the bug Something isn't working label Aug 15, 2022
pthavarasa added a commit to pthavarasa/uis-rnn that referenced this issue Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant