Comments (10)
环境
1.系统环境:Ubuntu 18.04
2.MegEngine版本:0.4.0
3.python版本:3.6.8
4.模型名称:retinanet_res50_1x_800size复现步骤
请提供关键的代码片段便于追查问题
from megengine import hub
model = hub.load(
"megengine/models",
"retinanet_res50_1x_800size",
pretrained=True,
)请提供完整的日志及报错信息
Traceback (most recent call last):
File "", line 4, in
File "/usr/local/lib/python3.6/dist-packages/megengine/hub/hub.py", line 202, in load
raise RuntimeError("Cannot find callable {} in hubconf.py".format(entry))
RuntimeError: Cannot find callable retinanet_res50_1x_800size in hubconf.py
看起来是cache没更新的问题,可以使用
model = hub.load(
"megengine/models", "retinanet_res50_1x_800size",
pretrained=True, use_cache=False
)
试一下,应该会重新download一份新的retinanet
from models.
修改后报下面的错误:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/dist-packages/megengine/hub/hub.py", line 206, in load
module = getattr(hubmodule, entry)(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/megengine/hub/hub.py", line 317, in pretrained_model_func
model = func(**kwargs)
File "/root/.cache/megengine/hub/e093aa62cdf8f313/official/vision/detection/retinanet_res50_coco_1x_800size.py", line 23, in retinanet_res50_coco_1x_800size
return models.RetinaNet(models.RetinaNetConfig(), batch_size=batch_size, **kwargs)
File "/root/.cache/megengine/hub/e093aa62cdf8f313/official/vision/detection/models/retinanet.py", line 39, in init
bottom_up = resnet50(norm=layers.get_norm(self.cfg.resnet_norm))
File "/root/.cache/megengine/hub/e093aa62cdf8f313/official/vision/detection/layers/basic/norm.py", line 71, in get_norm
"SyncBN": M.SyncBatchNorm,
AttributeError: module 'megengine.module' has no attribute 'SyncBatchNorm'
from models.
修改后报下面的错误:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/dist-packages/megengine/hub/hub.py", line 206, in load
module = getattr(hubmodule, entry)(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/megengine/hub/hub.py", line 317, in pretrained_model_func
model = func(**kwargs)
File "/root/.cache/megengine/hub/e093aa62cdf8f313/official/vision/detection/retinanet_res50_coco_1x_800size.py", line 23, in retinanet_res50_coco_1x_800size
return models.RetinaNet(models.RetinaNetConfig(), batch_size=batch_size, **kwargs)
File "/root/.cache/megengine/hub/e093aa62cdf8f313/official/vision/detection/models/retinanet.py", line 39, in init
bottom_up = resnet50(norm=layers.get_norm(self.cfg.resnet_norm))
File "/root/.cache/megengine/hub/e093aa62cdf8f313/official/vision/detection/layers/basic/norm.py", line 71, in get_norm
"SyncBN": M.SyncBatchNorm,
AttributeError: module 'megengine.module' has no attribute 'SyncBatchNorm'
哦哦,这个是0.5.0里面即将发布的Sync bn,目前0.4.0还不支持,可以把这一行注释掉
from models.
您好,我看了retinanet的配置,并没有用Sync bn
class RetinaNetConfig:
def init(self):
self.resnet_norm = "FrozenBN"
self.backbone_freeze_at = 2
retinanet_res50_coco_1x_800size.py
from megengine import hub
from official.vision.detection import models
@hub.pretrained(
"https://data.megengine.org.cn/models/weights/"
"retinanet_d3f58dce_res50_1x_800size_36dot0.pkl"
)
def retinanet_res50_coco_1x_800size(batch_size=1, **kwargs):
r"""
RetinaNet trained from COCO dataset.
"RetinaNet" <https://arxiv.org/abs/1708.02002>
_
"""
return models.RetinaNet(models.RetinaNetConfig(), batch_size=batch_size, **kwargs)
Net = models.RetinaNet
Cfg = models.RetinaNetConfig
并没有调用retinanet_res50_coco_1x_800size_syncbn.py
from models.
您好,我看了retinanet的配置,并没有用Sync bn
class RetinaNetConfig:
def init(self):
self.resnet_norm = "FrozenBN"
self.backbone_freeze_at = 2retinanet_res50_coco_1x_800size.py
from megengine import hub
from official.vision.detection import models
@hub.pretrained(
"https://data.megengine.org.cn/models/weights/"
"retinanet_d3f58dce_res50_1x_800size_36dot0.pkl"
)
def retinanet_res50_coco_1x_800size(batch_size=1, **kwargs):
r"""
RetinaNet trained from COCO dataset.
"RetinaNet" <https://arxiv.org/abs/1708.02002>
_
"""
return models.RetinaNet(models.RetinaNetConfig(), batch_size=batch_size, **kwargs)Net = models.RetinaNet
Cfg = models.RetinaNetConfig并没有调用retinanet_res50_coco_1x_800size_syncbn.py
没有使用sync bn的原因是相关的模型还在训练中,另外模型提交到hub也需要一定时间
from models.
那是不是现在retinanet模型的预训练权重还无法使用?需要自己重新训练
from models.
那是不是现在retinanet模型的预训练权重还无法使用?需要自己重新训练
可以使用啊,只不过是sync bn的功能不支持而已,正常RetinaNet使用的是Frozen BN
from models.
您好,现在的代码中就是使用的Frozen BN,不知道为什么说用了sync bn,您可以试一下看看是不是有问题?
from models.
您好,现在的代码中就是使用的Frozen BN,不知道为什么说用了sync bn,您可以试一下看看是不是有问题?
您好,这个地方多了一个SyncBn,而现在0.4.0版本的MegEngine并不支持,我的意思是注释掉这一行你就可以正常使用RetinaNet了,您可以试一下
from models.
OK,谢谢!
from models.
Related Issues (20)
- 请问有没有 GPT2-ML 预训练模型,希望结合 DTR 进行微调 HOT 4
- 量化模型的时候出现不预期的问题 HOT 1
- COCO数据集测试速度异常 HOT 2
- Missing Code(有代码遗漏导致无法运行) HOT 1
- Missing Code(代码遗漏导致无法运行) HOT 1
- 为什么都不放一下训好的模型权重下载链接? HOT 1
- resnet分类模型无法指定分类数量
- 关于DetectionPadCollator HOT 1
- About '3x' in configs like 'atss_res101_coco_3x_800size.py' HOT 5
- 训练segmentation的时候出现nan HOT 1
- 大佬求帮助,我在训练语义分割的时候,自定义了模型的数据输入,然后训练时偶发性报错'mgb::CudaError' HOT 1
- imagenet数据集 HOT 1
- 训练出错(https://github.com/MegEngine/Models/tree/master/official/quantization) HOT 5
- NLP部分的模型试验过程发现无法按照readme运行 HOT 1
- 需要贵公司thundernet的开源 HOT 2
- 有关shufflenet训练学习率的问题 HOT 2
- 无法dump resnet50的量化模型 HOT 1
- add type in argparse
- 想要直接训练好的量化模型(resnet50)来测速 HOT 1
- mutliprocess 替换成dist.launcher 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 models.