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.Videocan't, leaving a black block so I have to delete the- gr.Video
- The download files are automatically renamed as- downloadinstead of- xxxx_smpl.obj, and- download.txtfor- xx_smpl.npy
- [URGENT] OOM for GPU after testing a few images, thus I have to restart the space again and again for users
- demo.launch(auth=)does not work, after a few minutes, it turns out to be 504 gateway
- the visualization of .objfile is flipped, but.glbdisplays 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
backwardon 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-pythoninstalled from PyPI is not built withx264due to a license issue, so theavc1codec is not available with it.
As a workaround, you can callffmpegcommand usingsubprocess.runlike this: https://huggingface.co/spaces/hysts/ViTPose_video/blob/main/model.py#L242-L244
As another workaround, you can useimageioandimageio-ffmpegto 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
downloadinstead ofxxxx_smpl.obj, anddownload.txtforxx_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

 
						 
						