Spaces:
Runtime error
Existing problems
Thanks, @chris-rannou @hysts @fffiloni @NimaBoscarino , we have finished the main part, but still a few issues as follows:
Though the video could be played well locally,gr.Video
can't, leaving a black block so I have to delete thegr.Video
The download files are automatically renamed asdownload
instead ofxxxx_smpl.obj
, anddownload.txt
forxx_smpl.npy
[URGENT] OOM for GPU after testing a few images, thus I have to restart the space again and again for usersdemo.launch(auth=)
does not work, after a few minutes, it turns out to be 504 gateway- the visualization of
.obj
file is flipped, but.glb
displays correctly
The download issue should be fixed here: https://github.com/gradio-app/gradio/pull/1921 Aiming to ship in 3.2 release at the end of the next week but can cut a release earlier if needed. Same for auth - aiming to be fixed by the end of next week.
Regarding OOM, is it possible to not retain the graph when calling backward
on cloth_loss here?
The download issue should be fixed here: https://github.com/gradio-app/gradio/pull/1921 Aiming to ship in 3.2 release at the end of the next week but can cut a release earlier if needed. Same for auth - aiming to be fixed by the end of next week.
Regarding OOM, is it possible to not retain the graph when calling
backward
on cloth_loss here?
I have solved the OOM problem by removing the retain_graph=True
and add these codes at the end of processing function
import gc
# clean all the variables
for element in dir():
if 'path' not in element:
del locals()[element]
gc.collect()
torch.cuda.empty_cache()
- Though the video could be played well locally, gr.Video can't, leaving a black block so I have to delete the gr.Video
I had the same issue a little while ago. I think you need to use a different video codec.
https://huggingface.co/spaces/Yuliang/ICON/blob/main/lib/common/render.py#L344
https://github.com/gradio-app/gradio/issues/1508#issuecomment-1154545730
But in my understanding, opencv-python
installed from PyPI is not built with x264
due to a license issue, so the avc1
codec is not available with it.
As a workaround, you can call ffmpeg
command using subprocess.run
like this: https://huggingface.co/spaces/hysts/ViTPose_video/blob/main/model.py#L242-L244
As another workaround, you can use imageio
and imageio-ffmpeg
to create a video encoded with avc1
, instead of cv2.VideoWriter
.
- Though the video could be played well locally, gr.Video can't, leaving a black block so I have to delete the gr.Video
I had the same issue a little while ago. I think you need to use a different video codec.
https://huggingface.co/spaces/Yuliang/ICON/blob/main/lib/common/render.py#L344
https://github.com/gradio-app/gradio/issues/1508#issuecomment-1154545730But in my understanding,
opencv-python
installed from PyPI is not built withx264
due to a license issue, so theavc1
codec is not available with it.
As a workaround, you can callffmpeg
command usingsubprocess.run
like this: https://huggingface.co/spaces/hysts/ViTPose_video/blob/main/model.py#L242-L244
As another workaround, you can useimageio
andimageio-ffmpeg
to create a video encoded withavc1
, instead ofcv2.VideoWriter
.
Really thanks for your suggestion, now the video visualization works!
- The download files are automatically renamed as
download
instead ofxxxx_smpl.obj
, anddownload.txt
forxx_smpl.npy
Regarding this problem, i found 2 topics on gradio github's discussions page that could help you figure it out:
gr.File() file content read:
โโบ https://github.com/gradio-app/gradio/discussions/1624
How to get original uploaded file name instead of temporary file name ?:
โโบ https://github.com/gradio-app/gradio/discussions/133
โโโโโโโโโโโโโ
It seems that there is a bug about this though, as reported here:
Download button does not respect the filepath returned by the function:
demo.launch(auth=)
does not work, after a few minutes, it turns out to be 504 gateway
regarding the auth issue, @abidlabs said :
Auth is now working on Gradio 3.0 (thanks @pngwn !).
However, it does not work with Spaces -- so leaving this issue open (albeit renamed).
โโบ https://github.com/gradio-app/gradio/issues/1259#issuecomment-1128922425