kan-bayashi / PytorchWaveNetVocoder

WaveNet-Vocoder implementation with pytorch.

Home Page:https://kan-bayashi.github.io/WaveNetVocoderSamples/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: numpy.ufunc has the wrong size, try recompiling. Expected 192, got 216

RoelVdP opened this issue · comments

Hi, hope you can help.

I've been trying a good part of the day, but cannot get this to work. The issue is seen here;

########################################################### 
#                 DATA PREPARATION STEP                   #
###########################################################
###########################################################
#               FEATURE EXTRACTION STEP                   #
###########################################################
run.pl: job failed, log is in exp/feature_extract/feature_extract_tr_slt.log

And the matching error form the log is this;

# feature_extract.py --waveforms data/tr_slt/wav.scp --wavdir wav/tr_slt --hdf5dir hdf5/tr_slt --feature_type world --fs 16000 --shiftms 5 --minf0 120 --maxf0 275 --mcep_dim 24 --mcep_alpha 0.410 --highpass_cutoff 70 --fftl 1024 --n_jobs 10 
# Started at Mon  1 Apr 13:13:54 AEDT 2019
#
Traceback (most recent call last):
  File "../../../src/bin/feature_extract.py", line 19, in <module>
    import pysptk
  File "/home/roel/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pysptk/__init__.py", line 41, in <module>
    from .sptk import *  # pylint: disable=wildcard-import
  File "/home/roel/PytorchWaveNetVocoder/tools/venv/lib/python3.6/site-packages/pysptk/sptk.py", line 147, in <module>
    from . import _sptk
  File "__init__.pxd", line 872, in init pysptk._sptk
ValueError: numpy.ufunc has the wrong size, try recompiling. Expected 192, got 216
# Accounting: time=2 threads=1
# Ended (code 1) at Mon  1 Apr 13:13:56 AEDT 2019, elapsed time 2 seconds

This does NOT seem related to numpy versions on the host or the virtual environment (tried both, in numerous ways and in numerous times with both versions of numpy, the originally required one (1.13.3) and the latest.

The "ValueError: numpy.ufunc has the wrong size, try recompiling. Expected 192, got 216" bug can be found all over the net, but no good writeups except for this one;
http://codebase.site/index.php/question/show_question_details/26004

I remain of the hope that manual building of each required item is not required.

Hope you have ideas/insights/"seen-this-before" comments.

I had the same problem. It seems happen to any version of numpy < 0.16.0 as discussed here automl/ConfigSpace#107
I installed numpy 0.16.0 on virtual environment and it worked. :D
Hope it's helpful

I am also encountering this ValueError and tried to fix (following @tuanad121 suggestion) by changing the following line in tools/requirements.txt before compiling:

original line: numpy==1.13.3
new line: numpy==0.16.0

However this causes the following error:

Collecting numpy==0.16.0 (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement numpy==0.16.0 (from -r requirements.txt (line 1)) (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0b3, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.11.1rc1, 1.11.1, 1.11.2rc1, 1.11.2, 1.11.3, 1.12.0b1, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.1rc1, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2)
No matching distribution found for numpy==0.16.0 (from -r requirements.txt (line 1))
Makefile:6: recipe for target 'venv/bin/activate' failed
make: *** [venv/bin/activate] Error 1

Anyone encounter this issue and have a robust fix?

Thanks!

UPDATE:
If I follow the link in @tuanad121 post:

automl/ConfigSpace#107

It becomes clear that the it should be:

numpy==1.16.0
NOT
numpy==0.16.0

As such, changing the following line in tools/requirements.txt before compiling:

original line: numpy==1.13.3
new line: numpy==1.16.0

will successfully pass the feature extraction stage and resolve this error:

###########################################################

FEATURE EXTRACTION STEP

###########################################################
1028/1028 data/tr_slt/wav.scp files are successfully processed.
104/104 data/ev_slt/wav.scp files are successfully processed.

I hope someone finds this helpful!

Hi all,
Sorry for late reply.
I reproduced this issue.

This can be solved by installing numpy before installing pysptk.
I will update Makefile to fix this issue.

Thanks @kan-bayashi

So in that case tools/requirements.txt should be left alone, and your change will lead to a successful compile whereby feature extraction does not encounter this issue?

Just install numpy before pip install -r requirement.txt
See 64eec1b

Fixed (#51)