Description
When I run inference.py, ERROR:
Loads checkpoint by local backend from path: scd_workdir3\iter_9000.pth
E:\anaconda3\envs\ban_net\lib\site-packages\mmseg\models\decode_heads\decode_head.py:120: UserWarning: For binary segmentation, we suggest usingout_channels = 1
to define the outputchannels of segmentor, and use threshold
to convert seg_logits
into a predictionapplying a threshold
warnings.warn('For binary segmentation, we suggest using'
E:\anaconda3\envs\ban_net\lib\site-packages\mmseg\models\builder.py:36: UserWarning: build_loss
would be deprecated soon, please use mmseg.registry.MODELS.build()
warnings.warn('build_loss
would be deprecated soon, please use '
E:\anaconda3\envs\ban_net\lib\site-packages\mmseg\models\losses\cross_entropy_loss.py:250: UserWarning: Default avg_non_ignore
is False, if you would like to ignore the certain label and average loss over non-ignore labels, which is the same with PyTorch official cross_entropy, set avg_non_ignore=True
.
warnings.warn(
12/13 17:28:18 - mmengine - WARNING - Failed to search registry with scope "opencd" in the "function" registry tree. As a workaround, the current "function" registry in "mmengine" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "opencd" is a correct scope, or whether the registry is initialized.
E:\anaconda3\envs\ban_net\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'opencd.visualization.cd_vis_backend.CDLocalVisBackend'>, please provide the save_dir
argument.
warnings.warn(f'Failed to add {vis_backend.class}, '
Inference ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Traceback (most recent call last):
File "d:\PROJECT\AI-Project\ChangeDetect\open-cd\predict.py", line 32, in
inferencer(img_pairs, show=False, out_dir=out_dir)
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmseg\apis\mmseg_inferencer.py", line 187, in call
return super().call(
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmengine\infer\infer.py", line 221, in call
for data in (track(inputs, description='Inference')
File "E:\anaconda3\envs\ban_net\lib\site-packages\rich\progress.py", line 168, in track
yield from progress.track(
File "E:\anaconda3\envs\ban_net\lib\site-packages\rich\progress.py", line 1210, in track
for value in sequence:
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmengine\infer\infer.py", line 291, in preprocess
yield from map(self.collate_fn, chunked_data)
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmengine\infer\infer.py", line 588, in _get_chunk_data
processed_data = next(inputs_iter)
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmcv\transforms\base.py", line 12, in call
return self.transform(results)
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmcv\transforms\wrappers.py", line 88, in transform
results = t(results) # type: ignore
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmcv\transforms\base.py", line 12, in call
return self.transform(results)
File "E:\anaconda3\envs\ban_net\lib\site-packages\mmcv\transforms\loading.py", line 345, in transform
self._load_seg_map(results)
File "d:\PROJECT\AI-Project\ChangeDetect\open-cd\opencd\datasets\transforms\loading.py", line 275, in _load_seg_map
results['seg_map_path'], backend_args=self.backend_args)
KeyError: 'seg_map_path'
SCD change detection based on SECOND.The weights(.pt) were obtained by training the SECOND dataset.I gave the above error when I wanted to predict my own dataset.May I ask where I need to add the seg_map_path and what should be placed under the seg_map_path.