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

Problem with URL connection #144

Open
lindawang0122ds opened this issue Jul 22, 2024 · 2 comments
Open

Problem with URL connection #144

lindawang0122ds opened this issue Jul 22, 2024 · 2 comments

Comments

@lindawang0122ds
Copy link

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
Screenshot 2024-07-22 at 2 40 49 PM

@lindawang0122ds
Copy link
Author

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.

@1030zero
Copy link

1030zero commented Sep 6, 2024

我使用 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=Truelaunch()重要

提示:您正在使用 gradio 版本 3.39.0,但版本 4.29.0 可用,请升级。
当我将http://127.0.0.1:7863粘贴到 Google Chrome 时,网站显示:

无法访问此站点127.0.0.1 拒绝连接。 请尝试:

检查连接 检查代理和防火墙 ERR_CONNECTION_REFUSED 截图于 2024-07-22 下午 2 点 40 分 49 秒

Did you resolve it? I encountered the same issue.

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

2 participants