Comments (13)
from multi-label-sewer-classification.
Traceback (most recent call last):
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 186, in
run_inference(args)
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 128, in run_inference
model.load_state_dict(updated_state_dict)
File "C:\ProgramData\anaconda3\envs\torch\lib\site-packages\torch\nn\modules\module.py", line 2152, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Xie2019:
Missing key(s) in state_dict: "features.5.weight", "features.5.bias", "features.8.weight", "features.8.bias".
Unexpected key(s) in state_dict: "features.3.weight", "features.3.bias", "features.6.weight", "features.6.bias".
size mismatch for features.0.weight: copying a param with shape torch.Size([64, 3, 11, 11]) from checkpoint, the shape in current model is torch.Size([64, 11, 11, 11]).
from multi-label-sewer-classification.
还有就是训练好的模型是不是都是ckpt格式的,但是我的输出是名称是events.out.tfevents.1714136754.PC-202310272034,导致加载模型时报错:Traceback (most recent call last):
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 186, in
run_inference(args)
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 111, in run_inference
updated_state_dict, model_name, num_classes, training_mode, br_defect = load_model(model_path, best_weights)
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 69, in load_model
model_last_ckpt = torch.load(last_ckpt_path)
File "C:\ProgramData\anaconda3\envs\torch\lib\site-packages\torch\serialization.py", line 1028, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\ProgramData\anaconda3\envs\torch\lib\site-packages\torch\serialization.py", line 1246, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '\x18'.
from multi-label-sewer-classification.
from multi-label-sewer-classification.
from multi-label-sewer-classification.
请问那这两个问题应该怎样解决呢
from multi-label-sewer-classification.
你把你的模型结构代码和推理代码贴出来,我瞅瞅
from multi-label-sewer-classification.
可以给一下邮箱,通过邮箱发送吗
from multi-label-sewer-classification.
已发送谢谢
from multi-label-sewer-classification.
请问收到邮件了吗
from multi-label-sewer-classification.
- 模型应该加载你保存的ckpt
- 前向传播这可以直接add
- 你修改的模型是放在sewer_models.py或者ml_models.py里的吗?因为我没看到你的调用
from multi-label-sewer-classification.
1.加载events.out.tfevents格式的还是会报错:Traceback (most recent call last):
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 187, in
run_inference(args)
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 112, in run_inference
updated_state_dict, model_name, num_classes, training_mode, br_defect = load_model(model_path, best_weights)
File "E:\Multi-label-Sewer-Classification-main\inference.py", line 70, in load_model
model_last_ckpt = torch.load(last_ckpt_path)
File "C:\ProgramData\anaconda3\envs\torch\lib\site-packages\torch\serialization.py", line 1028, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\ProgramData\anaconda3\envs\torch\lib\site-packages\torch\serialization.py", line 1246, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '\x18'.
但是测试ckpt的文件却能成功
2.前向传播是之前像用注意力机制融合但是没成功所以用的add
3.你是说训练完成events.out.tfevents格式的模型文件吗
from multi-label-sewer-classification.
我可以给你我的模型文件请问能帮我解决吗
from multi-label-sewer-classification.
Related Issues (11)
- 数据集问题 HOT 2
- # EMAIL HOT 1
- test questions HOT 1
- lear-gist-python HOT 3
- datasets HOT 3
- 复现问题 HOT 4
- 测试集标注问题 HOT 1
- 加载模型的状态字典时报错 HOT 1
- 测试结果 HOT 19
- 请问数据集的下载太慢怎么办 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multi-label-sewer-classification.