I am trying to adapt the CascadetabNet code for pytorch 2.0.
Apparently for this mmdet 3 is needed, so I installed it with mim
mim install "mmdet>=3.0.0rc7"
So the code looks like this
<code>from mmdet.apis import init_detector, inference_detector
import mmcv
# Load model
config_file = 'path/to/config.py'
checkpoint_file = '/content/epoch_36.pth'
model = init_detector(config_file, checkpoint_file, device='cuda:0')
</code>
<code>from mmdet.apis import init_detector, inference_detector
import mmcv
# Load model
config_file = 'path/to/config.py'
checkpoint_file = '/content/epoch_36.pth'
model = init_detector(config_file, checkpoint_file, device='cuda:0')
</code>
from mmdet.apis import init_detector, inference_detector
import mmcv
# Load model
config_file = 'path/to/config.py'
checkpoint_file = '/content/epoch_36.pth'
model = init_detector(config_file, checkpoint_file, device='cuda:0')
And the start of the config file has this pretrained parameter
<code># model settings
model = dict(
type='CascadeRCNN',
# num_stages=3,
pretrained='open-mmlab://msra/hrnetv2_w32',
backbone=dict(
</code>
<code># model settings
model = dict(
type='CascadeRCNN',
# num_stages=3,
pretrained='open-mmlab://msra/hrnetv2_w32',
backbone=dict(
</code>
# model settings
model = dict(
type='CascadeRCNN',
# num_stages=3,
pretrained='open-mmlab://msra/hrnetv2_w32',
backbone=dict(
which apparently does not exist for mmdet 3.x
AttributeError: 'NoneType' object has no attribute 'rpn'
Anyone has an idea how to adapt this ?
I tried to remove the parameter and it gave me this
AttributeError: 'NoneType' object has no attribute 'rpn'