tyiannak / pyAudioAnalysis

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Apache License 2.0
5.84k stars 1.19k forks source link

Pickle error: "ImportError: No module named copy_reg" #51

Open BaddMann opened 7 years ago

BaddMann commented 7 years ago

based on some of the other issues reported here, TensorFlow is having issues with Windows. I respect that is out of your hands.

I am curious about Pickle on a windows machine though. I'm using your simple example on the segmentation part of your wiki.

python audioAnalysis.py silenceRemoval -i data/recording3.wav --smoothing 1.0 --weight 0.3 python audioAnalysis.py classifyFolder -i data/recording3_ --model svm --classifier data/svmSM --detail

Love this on my macs, works out, a charm and it's the foot hold I need to understand your code better as I explore.

Then I ran through every dependency to get this working on windows. The first Command worked after a lot of sweet and tears, but I can't get any headway on command 2. What I've read there are definitely some issues with pickle and the way carriage return happens on Windows.

EX: http://stackoverflow.com/questions/5927606/pickle-load-not-working and http://stackoverflow.com/questions/556269/importerror-no-module-named-copy-reg-pickle

here's my error:

C:\Users\USER1\Documents\GitHub\pyAudioAnalysis>python audioAnalysis.py
uments\Extracts --model svm --classifier C:\Users\USER1\Documents\GitHub
Traceback (most recent call last):
  File "audioAnalysis.py", line 462, in <module>
    classifyFolderWrapper(args.input, args.model, args.classifier, args.details)
  File "audioAnalysis.py", line 139, in classifyFolderWrapper
    [Result, P, classNames] = aT.fileClassification(wavFile, modelName, modelTyp
  File "C:\Users\USER1\Documents\GitHub\pyAudioAnalysis\audioTrainTest.p
    [Classifier, MEAN, STD, classNames, mtWin, mtStep, stWin, stStep, computeBEA
  File "C:\Users\USER1\Documents\GitHub\pyAudioAnalysis\audioTrainTest.p
    SVM = cPickle.load(fid)
ImportError: No module named copy_reg

Any Advice is much appreciate and I'll run with anything you give me, just please point me in a direction, I'll run down that lead like a dog.

dzad commented 7 years ago

i have the same issue here. it seems the problem is that the master dumped the file svmSM in linux or mac but when we use it on win we get problems. if he can redump it using win i think we can run it normally.

graichen commented 6 years ago

you can also try unix2dos command when going to windows, since dos2unix worked when going to linux from windows (see https://stackoverflow.com/questions/556269/importerror-no-module-named-copy-reg-pickle)

4tome commented 6 years ago

I know this is old but I have this issue, did you find a solution?

Xonshiz commented 5 years ago

This worked for me : https://stackoverflow.com/a/53942341/2408212