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

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

Open
shirounanashi opened this issue Mar 19, 2024 · 6 comments
Open

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

shirounanashi opened this issue Mar 19, 2024 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@shirounanashi
Copy link

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
Copy link
Contributor

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
Copy link
Author

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

@alcoftTAO
Copy link
Contributor

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
Copy link
Author

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

@Tps-F
Copy link
Member

Tps-F commented Mar 22, 2024

@shirounanashi could you tell me your environment?

@Tps-F Tps-F added bug Something isn't working help wanted Extra attention is needed labels Mar 22, 2024
@shirounanashi
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants