Problem with URL connection
I use gradio 3.39.0 to run Track-Anything Model. However, the local URL generated by gradio refuse to connect when I pasted the URL into the Google Chrome.
My setting: Python 3.10.11 Gradio 3.39.0
I use the Linux system O2 portal and use the terminal in O2 portal to run the program so I'm not quite sure if gradio actually generate a local URL or not.
I also modified app.py: iface.queue(concurrency_count=1) #iface.launch(debug=True, enable_queue=True, server_port=args.port, server_name="0.0.0.0") # commanded by Linda iface.launch(debug=True, enable_queue=True) # Linda's modified code
Following is the output in terminal when I run app.py:
[suw469@compute-g-17-145 Track-Anything]$ python app.py --device cuda:0
/home/suw469/.local/lib/python3.10/site-packages/gradio_client/documentation.py:105: UserWarning: Could not get documentation group for <class 'gradio.mix.Parallel'>: No known documentation group for module 'gradio.mix'
warnings.warn(f"Could not get documentation group for {cls}: {exc}")
/home/suw469/.local/lib/python3.10/site-packages/gradio_client/documentation.py:105: UserWarning: Could not get documentation group for <class 'gradio.mix.Series'>: No known documentation group for module 'gradio.mix'
warnings.warn(f"Could not get documentation group for {cls}: {exc}")
Initializing BaseSegmenter to cuda:0
Hyperparameters read from the model weights: C^k=64, C^v=512, C^h=64
Single object mode: False
load pretrained SPyNet...
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmediting/restorers/basicvsr/spynet_20210409-c6c1bd09.pth
/home/suw469/Track-Anything/app.py:434: GradioUnusedKwargWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 0.4}
with gr.Row(scale=0.4):
/home/suw469/Track-Anything/app.py:435: GradioUnusedKwargWarning: You have unused kwarg parameters in Video, please remove them: {'autosize': True}
video_input = gr.Video(autosize=True)
/home/suw469/Track-Anything/app.py:460: GradioDeprecationWarning: The style method is deprecated. Please set these arguments in the constructor instead.
clear_button_click = gr.Button(value="Clear clicks", interactive=True, visible=False).style(height=160)
/home/suw469/Track-Anything/app.py:462: GradioDeprecationWarning: The style method is deprecated. Please set these arguments in the constructor instead.
template_frame = gr.Image(type="pil",interactive=True, elem_id="template_frame", visible=False).style(height=360)
/home/suw469/Track-Anything/app.py:469: GradioUnusedKwargWarning: You have unused kwarg parameters in Video, please remove them: {'autosize': True}
video_output = gr.Video(autosize=True, visible=False).style(height=360)
/home/suw469/Track-Anything/app.py:469: GradioDeprecationWarning: The style method is deprecated. Please set these arguments in the constructor instead.
video_output = gr.Video(autosize=True, visible=False).style(height=360)
/home/suw469/.local/lib/python3.10/site-packages/gradio/utils.py:833: UserWarning: Expected 4 arguments for function <function select_template at 0x7f23102b6830>, received 3.
warnings.warn(
/home/suw469/.local/lib/python3.10/site-packages/gradio/utils.py:837: UserWarning: Expected at least 4 arguments for function <function select_template at 0x7f23102b6830>, received 3.
warnings.warn(
/home/suw469/Track-Anything/app.py:605: GradioDeprecationWarning: The enable_queue parameter has been deprecated. Please use the .queue() method instead.
iface.launch(debug=True, enable_queue=True) # Linda's modified code
Running on local URL: http://127.0.0.1:7863
To create a public link, set share=True in launch().
IMPORTANT: You are using gradio version 3.39.0, however version 4.29.0 is available, please upgrade.
When I pasted http://127.0.0.1:7863 to Google Chrome, the website shows:
This site can’t be reached127.0.0.1 refused to connect. Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
Also, is it possible to upgrade Track-Anything Model to be suitable for the latest version of Gradio? I reached out to the developer of Gradio to debug the issue above but they told me they no longer provide support for old version Gradio and suggest upgrade the model.
我使用 gradio 3.39.0 运行 Track-Anything Model。但是当我将 gradio 生成的本地 URL 粘贴到 Google Chrome 中时,它拒绝连接。
我的设置: Python 3.10.11 Gradio 3.39.0
我使用 Linux 系统 O2 门户并使用 O2 门户中的终端来运行该程序,所以我不太确定 gradio 是否真的生成了本地 URL。
我还修改了 app.py:iface.queue(concurrency_count=1 ) #iface.launch(debug=True, enable_queue=True, server_port=args.port, server_name="0.0.0.0") # 由 Linda 指挥 iface.launch(debug=True, enable_queue=True) # Linda 修改的代码
以下是我运行 app.py 时终端中的输出: [suw469@compute-g-17-145 Track-Anything]$ python app.py --device cuda:0 /home/suw469/.local/lib/python3.10/site-packages/gradio_client/documentation.py:105: UserWarning: 无法获取 <class 'gradio.mix.Parallel'> 的文档组:没有已知的模块'gradio.mix' 文档组 warnings.warn(f"无法获取 {cls} 的文档组:{exc}") /home/suw469/.local/lib/python3.10/site-packages/gradio_client/documentation.py:105: UserWarning: 无法获取 <class 'gradio.mix.Series'> 的文档组:没有已知的模块'gradio.mix' 文档组 warnings.warn(f"无法获取{cls}:{exc}”) 将 BaseSegmenter 初始化为 cuda:0 从模型权重读取的超参数:C^k=64、C^v=512、C^h=64 单对象模式:False 加载预训练的 SPyNet…… 通过 http 后端从路径加载检查点:https://download.openmmlab.com/mmediting/restorers/basicvsr/spynet_20210409-c6c1bd09.pth /home/suw469/Track-Anything/app.py:434:GradioUnusedKwargWarning:您在 Row 中有未使用的 kwarg 参数,请将其删除:{'scale': 0.4} 与 gr.Row(scale=0.4): /home/suw469/Track-Anything/app.py:435:GradioUnusedKwargWarning:您有未使用的 kwarg Video 中的参数,请将其删除:{'autosize': True} video_input = gr.Video(autosize=True) /home/suw469/Track-Anything/app.py:460: GradioDeprecationWarning: 该
style方法已弃用。请在构造函数中设置这些参数。 clear_button_click = gr.Button(value="Clear clicks", interactive=True, visible=False).style(height=160) /home/suw469/Track-Anything/app.py:462: GradioDeprecationWarning: 该style方法已弃用。请在构造函数中设置这些参数。 template_frame = gr.Image(type="pil",interactive=True, elem_id="template_frame", visible=False).style(height=360) /home/suw469/Track-Anything/app.py:469: GradioUnusedKwargWarning: Video 中有未使用的 kwarg 参数,请将其移除:{'autosize': True} video_output = gr.Video(autosize=True, visible=False).style(height=360) /home/suw469/Track-Anything/app.py:469: GradioDeprecationWarning: 此style方法已弃用。请在构造函数中设置这些参数。 video_output = gr.Video(autosize=True, visible=False).style(height=360) /home/suw469/.local/lib/python3.10/site-packages/gradio/utils.py:833: UserWarning: 函数 <function select_template at 0x7f23102b6830> 需要 4 个参数,收到 3 个 。warnings.warn( /home/suw469/.local/lib/python3.10/site-packages/gradio/utils.py:837:UserWarning:函数 <function select_template at 0x7f23102b6830> 至少需要 4 个参数,但收到 3 个 。warnings.warn( /home/suw469/Track-Anything/app.py:605:GradioDeprecationWarning:该enable_queue参数已被弃用。请使用该.queue()方法代替。iface.launch (debug=True, enable_queue=True) # Linda 修改后的代码 在本地 URL 上运行: http://127.0.0.1:7863要创建公共链接,请设置
share=True。launch()重要提示:您正在使用 gradio 版本 3.39.0,但版本 4.29.0 可用,请升级。 当我将http://127.0.0.1:7863粘贴到 Google Chrome 时,网站显示:
无法访问此站点127.0.0.1 拒绝连接。 请尝试:
检查连接 检查代理和防火墙 ERR_CONNECTION_REFUSED
Did you resolve it? I encountered the same issue.
I use gradio 3.39.0 to run Track-Anything Model. However, the local URL generated by gradio refuse to connect when I pasted the URL into the Google Chrome.
My setting: Python 3.10.11 Gradio 3.39.0
I use the Linux system O2 portal and use the terminal in O2 portal to run the program so I'm not quite sure if gradio actually generate a local URL or not.
I also modified app.py: iface.queue(concurrency_count=1) #iface.launch(debug=True, enable_queue=True, server_port=args.port, server_name="0.0.0.0") # commanded by Linda iface.launch(debug=True, enable_queue=True) # Linda's modified code
Following is the output in terminal when I run app.py: [suw469@compute-g-17-145 Track-Anything]$ python app.py --device cuda:0 /home/suw469/.local/lib/python3.10/site-packages/gradio_client/documentation.py:105: UserWarning: Could not get documentation group for <class 'gradio.mix.Parallel'>: No known documentation group for module 'gradio.mix' warnings.warn(f"Could not get documentation group for {cls}: {exc}") /home/suw469/.local/lib/python3.10/site-packages/gradio_client/documentation.py:105: UserWarning: Could not get documentation group for <class 'gradio.mix.Series'>: No known documentation group for module 'gradio.mix' warnings.warn(f"Could not get documentation group for {cls}: {exc}") Initializing BaseSegmenter to cuda:0 Hyperparameters read from the model weights: C^k=64, C^v=512, C^h=64 Single object mode: False load pretrained SPyNet... Loads checkpoint by http backend from path: https://download.openmmlab.com/mmediting/restorers/basicvsr/spynet_20210409-c6c1bd09.pth /home/suw469/Track-Anything/app.py:434: GradioUnusedKwargWarning: You have unused kwarg parameters in Row, please remove them: {'scale': 0.4} with gr.Row(scale=0.4): /home/suw469/Track-Anything/app.py:435: GradioUnusedKwargWarning: You have unused kwarg parameters in Video, please remove them: {'autosize': True} video_input = gr.Video(autosize=True) /home/suw469/Track-Anything/app.py:460: GradioDeprecationWarning: The
stylemethod is deprecated. Please set these arguments in the constructor instead. clear_button_click = gr.Button(value="Clear clicks", interactive=True, visible=False).style(height=160) /home/suw469/Track-Anything/app.py:462: GradioDeprecationWarning: Thestylemethod is deprecated. Please set these arguments in the constructor instead. template_frame = gr.Image(type="pil",interactive=True, elem_id="template_frame", visible=False).style(height=360) /home/suw469/Track-Anything/app.py:469: GradioUnusedKwargWarning: You have unused kwarg parameters in Video, please remove them: {'autosize': True} video_output = gr.Video(autosize=True, visible=False).style(height=360) /home/suw469/Track-Anything/app.py:469: GradioDeprecationWarning: Thestylemethod is deprecated. Please set these arguments in the constructor instead. video_output = gr.Video(autosize=True, visible=False).style(height=360) /home/suw469/.local/lib/python3.10/site-packages/gradio/utils.py:833: UserWarning: Expected 4 arguments for function <function select_template at 0x7f23102b6830>, received 3. warnings.warn( /home/suw469/.local/lib/python3.10/site-packages/gradio/utils.py:837: UserWarning: Expected at least 4 arguments for function <function select_template at 0x7f23102b6830>, received 3. warnings.warn( /home/suw469/Track-Anything/app.py:605: GradioDeprecationWarning: Theenable_queueparameter has been deprecated. Please use the.queue()method instead. iface.launch(debug=True, enable_queue=True) # Linda's modified code Running on local URL: http://127.0.0.1:7863To create a public link, set
share=Trueinlaunch().IMPORTANT: You are using gradio version 3.39.0, however version 4.29.0 is available, please upgrade. When I pasted http://127.0.0.1:7863 to Google Chrome, the website shows:
This site can’t be reached127.0.0.1 refused to connect. Try:
Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED
I have also encountered this problem before, and after trying to change the Gradio version to Gradio==3.48.0, it was resolved. Additionally, you can try modifying the server name in app. py: iface.launch(debug=True, enable_queue=True, server_port=args.port, server_name="127.0.0.1")
My settings: python:3.12.9 on Win11 system

