RVC-Project / Retrieval-based-Voice-Conversion

in preparation...
MIT License
294 stars 45 forks source link

AttributeError: 'NoneType' object has no attribute 'dtype' #20

Open shirounanashi opened 8 months ago

shirounanashi commented 8 months ago

When I try to make an inference by outputting the file name, I get this error.

Traceback (most recent call last):
  File "/opt/conda/bin/rvc", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.10/site-packages/rvc/utils/cli/cli.py", line 29, in main
    cli()
  File "/opt/conda/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/opt/conda/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/conda/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/conda/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/rvc/utils/cli/handler/infer.py", line 130, in infer
    wavfile.write(outputpath, tgt_sr, audio_opt)
  File "/opt/conda/lib/python3.10/site-packages/scipy/io/wavfile.py", line 771, in write
    dkind = data.dtype.kind
AttributeError: 'NoneType' object has no attribute 'dtype'

And when I put "-o" as a folder, it gives an error saying it is a directory Sorry for the bad English, I used Google Translate

alcoftTAO commented 8 months ago

I also had this error, in my case it was because my GPU ran out of memory. I don't know if this is the case for you too, but I would recommend checking your GPU memory while doing the inference.

shirounanashi commented 8 months ago

@alcoftTAO I don't think that's the problem here since I was using a T4

alcoftTAO commented 8 months ago

I think an error is occurring during inference as it is returning None to scipy.

If you are using the API, make sure to put this:

curl -X 'POST' \
       'http://127.0.0.1:8000/inference' \
       -H 'accept: application/json' \
       -H 'Content-Type: multipart/form-data' \
       -F 'modelpath={model.pth}' \
       -F 'input={input audio path}' \
       -o {output audio path}

Where you replace {model.pth} with the .pth file of your model, {input audio path} with the audio file you want to make the inference to and {output audio path} with the file in which you want to save it.

I don't know if it will work as I have never used the API. If it doesn't work, try creating the output audio first and try again.

shirounanashi commented 8 months ago

I don't think this is the problem since I'm using CLI, not API

Tps-F commented 7 months ago

@shirounanashi could you tell me your environment?

shirounanashi commented 7 months ago

@Tps-F I was trying to use it on Kaggle