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

utils\util_image.py:269: RuntimeWarning: invalid value encountered in cast img_np = img_np.astype(out_type) #101

Open
puppyjuan opened this issue Oct 22, 2024 · 0 comments

Comments

@puppyjuan
Copy link

Hello author!
I run app.py and test using http://127.0.0.1:7860/. After I submit "Low Quality Image" using the sample image, I get a black "High Quality Image". The console output utils\util_image.py:269: RuntimeWarning: invalid value encountered in cast img_np = img_np.astype(out_type).
When I debug and step into util_image.py line 269, I found that the "img_np" value is all nan.
Can you help me with this problem? Thanks very much!

Bellow is the entire console output:
C:\ProgramData\Anaconda3\envs\resshift\python.exe D:/project2/ResShift_Efficient_Diffusion_Model_2023/app.py
D:\project2\ResShift_Efficient_Diffusion_Model_2023\app.py:192: GradioDeprecationWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components
gr.outputs.File(label="Download the output")
Running on local URL: http://127.0.0.1:7860
IMPORTANT: You are using gradio version 3.50.0, however version 4.44.1 is available, please upgrade.

Running on public URL: https://260c8f8a2b9875daf6.gradio.live

This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run gradio deploy from Terminal to deploy to Spaces (https://huggingface.co/spaces)
Building the diffusion model with length: 4...
C:\ProgramData\Anaconda3\envs\resshift\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:3527.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Loading Diffusion model from weights\resshift_bicsrx4_s4.pth...
building MemoryEfficientAttnBlock with 512 in_channels...
Working with z of shape (1, 3, 64, 64) = 12288 dimensions.
building MemoryEfficientAttnBlock with 512 in_channels...
Loading AutoEncoder model from weights\autoencoder_vq_f4.pth...
D:\project2\ResShift_Efficient_Diffusion_Model_2023\utils\util_image.py:269: RuntimeWarning: invalid value encountered in cast
img_np = img_np.astype(out_type)
Processing done, enjoy the results in restored_output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant