RuntimeError: mat1 and mat2 shapes cannot be multiplied (286720x7 and 1280x3) #1764
Unanswered
wenshuyuan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i want to utlize mobilenet v2 to train my own data.
i dont know what cause the error.
my config are as follows :
my_mobilenet_v2_3_classes.py
base = [
'../base/models/mobilenet_v2_1x.py',
#'../base/datasets/imagenet_bs32_pil_resize.py',
]
dataset settings
dataset_type = 'ImageNet'
data_preprocessor = dict(
)
train_pipeline = [
dict(type='LoadImageFromFile'),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
]
train_dataloader = dict(
batch_size=32,
num_workers=5,
dataset=dict(
type=dataset_type,
data_root='F:/研究生课程/mission/project/mmpretrain-main/datasets/clahe',
split='train',
pipeline=train_pipeline),
sampler=dict(type='DefaultSampler', shuffle=True),
)
val_dataloader = dict(
batch_size=32,
num_workers=5,
dataset=dict(
type=dataset_type,
data_root='F:/研究生课程/mission/project/mmpretrain-main/datasets/clahe',
split='val',
pipeline=test_pipeline),
sampler=dict(type='DefaultSampler', shuffle=False),
)
val_evaluator = dict(type='Accuracy', topk=(1, 5))
If you want standard test, please manually configure the test dataset
test_dataloader = val_dataloader
test_evaluator = val_evaluator
修改模型相关配置
model = dict(
type='ImageClassifier',
backbone=dict(
type='MobileNetV2',
#scale=1.0
#width_mult=1.0
),
neck=None,
head=dict(
type='LinearClsHead',
num_classes=3,
in_channels=1280,
loss=dict(type='CrossEntropyLoss', loss_weight=1.0),
)
)
修改训练相关配置
lr_config = dict(
policy='step',
step=[30, 60, 90],
gamma=0.1
)
runner = dict(
type='EpochBasedRunner',
max_epochs=100
)
Beta Was this translation helpful? Give feedback.
All reactions