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

VisibleDeprecationWarning and TypeError: can't convert cuda:0 device type tensor to numpy. #31

Open
ASR2020Guru opened this issue Mar 14, 2021 · 0 comments

Comments

@ASR2020Guru
Copy link

Thanks for the awesome toolkit.

After I installed all required packages.

I got the below warning message when I run the code glottal.py, articulaton.py respectively.

/usr/local/lib/python3.6/dist-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order, subok=True)
But I can get the desired output file.

When I run phonation.py or phonological.py, I can get the desired output file without any warning messages.

And if I run Representationlearning.py, I got the below error.

root@198c2471ad59:/codes/m456_smk/DisVoice/replearning# ./test_replearning.sh /usr/local/lib/python3.6/dist-packages/torch/nn/functional.py:1639: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") Traceback (most recent call last): File "replearning.py", line 225, in <module> script_manager(sys.argv, replearning) File "/codes/m456_smk/DisVoice/replearning/../script_mananger.py", line 31, in script_manager features=feature_method.extract_features_file(audio, static=static, plots=plots, fmt=fmt) File "replearning.py", line 110, in extract_features_file hb=self.AEspeech.compute_bottleneck_features(audio) File "/codes/m456_smk/DisVoice/replearning/AEspeech.py", line 177, in compute_bottleneck_features return bot.data.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. /usr/local/lib/python3.6/dist-packages/torch/nn/functional.py:1639: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") Traceback (most recent call last): File "replearning.py", line 225, in <module> script_manager(sys.argv, replearning) File "/codes/m456_smk/DisVoice/replearning/../script_mananger.py", line 31, in script_manager features=feature_method.extract_features_file(audio, static=static, plots=plots, fmt=fmt) File "replearning.py", line 110, in extract_features_file hb=self.AEspeech.compute_bottleneck_features(audio) File "/codes/m456_smk/DisVoice/replearning/AEspeech.py", line 177, in compute_bottleneck_features return bot.data.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

I tried several solutions based on similar issues on stackoverflow but none of them worked.

I am running these on docker. some environment as below shown:
Ubuntu 20.04.1
Python 3.6.9
Package Version


chainer 7.7.0
chardet 3.0.4
click 7.1.2
cloudpickle 1.3.0
cntk-gpu 2.7
cupy 7.8.0
cycler 0.10.0
Cython 0.29.21
grpcio 1.32.0
h5py 2.10.0
httplib2 0.18.1
idna 2.10
imageio 2.9.0
importlib-metadata 1.7.0
ipykernel 5.3.4
ipython 7.16.1
ipython-genutils 0.2.0
ipywidgets 7.5.1
kaldi-io 0.9.0
Keras 2.4.3
Keras-Preprocessing 1.1.2
librosa 0.8.0
matplotlib 3.0.2
numba 0.51.2
numpy 1.19.5
pandas 1.1.2
pandocfilters 1.4.2
parso 0.7.1
pathlib 1.0.1
pickleshare 0.7.5
Pillow 7.2.0
pip 21.0.1
pooch 1.2.0
praat-parselmouth 0.3.3
ptyprocess 0.6.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.20
pydub 0.24.1
Pygments 2.6.1
pygobject 3.26.1
pygpu 0.7.6
pyparsing 2.4.7
pyrsistent 0.16.0
PySocks 1.7.1
pysptk 0.1.16
python-apt 1.6.5+ubuntu0.3
python-dateutil 2.8.1
python-distutils-extra 2.39
python-gflags 1.5.1
python-speech-features 0.6
pytz 2021.1
PyWavelets 1.1.1
PyYAML 5.3.1
pyzmq 19.0.2
qtconsole 4.7.6
QtPy 1.9.0
scikit-image 0.17.2
scikit-learn 0.23.2
scipy 1.5.2
seaborn 0.9.0
Send2Trash 1.5.0
setuptools 54.1.1
simplegeneric 0.8.1
six 1.15.0
SoundFile 0.10.3.post1
stopit 1.1.1
suds-jurko 0.6
tabulate 0.8.7
tensorboard 2.4.1
tensorboard-plugin-wit 1.7.0
tensorflow 2.4.1
tensorflow-estimator 2.4.0
tensorflow-gpu 2.3.0
tensorflow-probability 0.11.0
Theano 1.0.5
threadpoolctl 2.1.0
tifffile 2020.8.25
torch 1.7.0
torchaudio 0.7.0
torchvision 0.8.0.dev20200828+cu101
Werkzeug 1.0.1
wheel 0.36.2
widgetsnbextension 3.5.1
wrapt 1.12.1
zipp 3.1.0

Could you help me with these?
Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant