-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Check and sync the num_classes in Config class #2477
Conversation
juncaipeng
commented
Aug 23, 2022
•
edited
Loading
edited
- Check and sync the num_classes in Config class
- Update the docs of quick_start demo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要再确认全局都已经没有config_check
train( | ||
cfg.model, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/train/eval 都需要增加sync_infor确认信息同步。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看了medicalseg中所有配置文件都提供了num_classes,而且medicalseg是使用自己定义的Config类,所以就没大改这里面的。
if len(num_classes_set) == 0: | ||
raise ValueError( | ||
'`num_classes` is not found. Please set it in model, train_dataset or val_dataset' | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在matting里不存在num_classes概念,是否能正常运行呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matting中之前也没有调用config_check函数,所以现在修改后,matting下面的cfg示例没调用check_sync_info函数,所以不影响matting的代码。
if hasattr(self.val_dataset_class, 'NUM_CLASSES'): | ||
num_classes_set.add(self.val_dataset_class.NUM_CLASSES) | ||
elif 'num_classes' in self.val_dataset_config: | ||
num_classes_set.add(self.val_dataset_config['num_classes']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是否存在必须构建val_dataset或者train_dataset呢,如果存在的话,执行predict.py时当dataset_root不存在能否正常运行呢?原来是报FileNotFoundError时给个警告而非报错
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
predict.py不需要构建val_dataset或train_dataset就应正常预测,如果会报错的话,不符合预期。
已经全部检查了 |