-
Notifications
You must be signed in to change notification settings - Fork 39
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
如何在demo_MLSD_flask中使用训练后的模型? #28
Comments
@Code-Dataset 你解决了嘛 |
我跟你一样的问题,请问你解决了吗 |
我解决了,需要改一部分代码
vince
***@***.***
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2024年4月20日(星期六) 晚上8:44
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [lhwcv/mlsd_pytorch] 如何在demo_MLSD_flask中使用训练后的模型? (Issue #28)
@Code-Dataset 你解决了嘛
我跟你一样的问题,请问你解决了吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
我解决了,最后我没采用flask运行,采用的gradio,但是原理是一样的,您可以看下mlsd_tiny.py这个文件,这个是我根据源码从新改的一份文件
vince
***@***.***
…------------------ 原始邮件 ------------------
发件人: "lhwcv/mlsd_pytorch" ***@***.***>;
发送时间: 2024年4月20日(星期六) 晚上8:44
***@***.***>;
***@***.******@***.***>;
主题: Re: [lhwcv/mlsd_pytorch] 如何在demo_MLSD_flask中使用训练后的模型? (Issue #28)
@Code-Dataset 你解决了嘛
我跟你一样的问题,请问你解决了吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
哥 您能发我邮箱吗,这里显示不出来,看不到文件 |
@syvince |
我也遇到了这个问题,可以给我发一份吗,谢谢! |
mlsd_tiny.py
|
web.py
|
您好,请问训练后存在workdir/models中的模型如何在demo_MLSD_flask.py中使用呢?
我运行后报错如下:
Traceback (most recent call last):
File "demo_MLSD_flask.py", line 296, in
init_worker(args)
File "demo_MLSD_flask.py", line 255, in init_worker
model = model_graph(args)
File "demo_MLSD_flask.py", line 86, in init
self.model = self.load(args.model_dir, args.model_type)
File "demo_MLSD_flask.py", line 105, in load
torch_model.load_state_dict(torch.load(model_path, map_location=device), strict=True)
File "C:\Users\ai\AppData\Roaming\Python\Python38\site-packages\torch\nn\modules\module.py", line 1671, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for MobileV2_MLSD_Tiny:
Unexpected key(s) in state_dict: "block17.weight", "block17.bias".
size mismatch for backbone.features.0.0.weight: copying a param with shape torch.Size([32, 3, 3, 3]) from checkpoint, the shape in current model is torch.Size([32, 4, 3, 3]).
The text was updated successfully, but these errors were encountered: