[GH-ISSUE #20] AttributeError: 'NoneType' object has no attribute 'dtype' #18

Open
opened 2026-10-20 09:53:07 +00:00 by bsakaguchi · 10 comments
Owner

Originally created by @shirounanashi on GitHub (Mar 19, 2024).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion/issues/20

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

Originally created by @shirounanashi on GitHub (Mar 19, 2024). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion/issues/20 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
Author
Owner

@alcoftTAO commented on GitHub (Mar 19, 2024):

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.

<!-- gh-comment-id:2007087781 --> @alcoftTAO commented on GitHub (Mar 19, 2024): 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.
Author
Owner

@shirounanashi commented on GitHub (Mar 19, 2024):

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

<!-- gh-comment-id:2007138096 --> @shirounanashi commented on GitHub (Mar 19, 2024): @alcoftTAO I don't think that's the problem here since I was using a T4
Author
Owner

@alcoftTAO commented on GitHub (Mar 19, 2024):

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.

<!-- gh-comment-id:2007168741 --> @alcoftTAO commented on GitHub (Mar 19, 2024): 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: ```sh 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.
Author
Owner

@shirounanashi commented on GitHub (Mar 19, 2024):

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

<!-- gh-comment-id:2007423080 --> @shirounanashi commented on GitHub (Mar 19, 2024): I don't think this is the problem since I'm using CLI, not API
Author
Owner

@Tps-F commented on GitHub (Mar 22, 2024):

@shirounanashi could you tell me your environment?

<!-- gh-comment-id:2014284083 --> @Tps-F commented on GitHub (Mar 22, 2024): @shirounanashi could you tell me your environment?
Author
Owner

@shirounanashi commented on GitHub (Mar 22, 2024):

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

<!-- gh-comment-id:2014332132 --> @shirounanashi commented on GitHub (Mar 22, 2024): @Tps-F I was trying to use it on Kaggle
Author
Owner

@wegylexy commented on GitHub (Jan 11, 2025):

github.com/RVC-Project/Retrieval-based-Voice-Conversion@fde29c73b5/rvc/modules/vc/pipeline.py (L138)
The rmvpe_gpu option is not implemented. Switching to rmvpe works for me but it runs on CPU then.

<!-- gh-comment-id:2584996553 --> @wegylexy commented on GitHub (Jan 11, 2025): https://github.com/RVC-Project/Retrieval-based-Voice-Conversion/blob/fde29c73b5812e83b0fae1bd0fc02ac544cba626/rvc/modules/vc/pipeline.py#L138 The `rmvpe_gpu` option is not implemented. Switching to `rmvpe` works for me but it runs on CPU then.
Author
Owner

@alcoftTAO commented on GitHub (Jan 11, 2025):

Try using:

vc.config.use_cuda()
<!-- gh-comment-id:2585273140 --> @alcoftTAO commented on GitHub (Jan 11, 2025): Try using: ```python vc.config.use_cuda() ```
Author
Owner

@wegylexy commented on GitHub (Jan 12, 2025):

Then the web-facing part of the API needs to translate that rmvpe_gpu to rmvpe and enable cuda when invoking the internal.

<!-- gh-comment-id:2585573256 --> @wegylexy commented on GitHub (Jan 12, 2025): Then the web-facing part of the API needs to translate that `rmvpe_gpu` to `rmvpe` and enable cuda when invoking the internal.
Author
Owner

@agonzalezd commented on GitHub (Jan 22, 2025):

Happened to me once when processing audio 8/9. Removed the rest of audios and it worked with the one that failed.
I hope this info further helps on this issue.

<!-- gh-comment-id:2607600087 --> @agonzalezd commented on GitHub (Jan 22, 2025): Happened to me once when processing audio 8/9. Removed the rest of audios and it worked with the one that failed. I hope this info further helps on this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion#18
No description provided.