Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions paddleseg/datasets/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,19 @@ def __init__(self,
self.dataset_root = dataset_root
self.transforms = Compose(transforms)
self.file_list = list()
mode = mode.lower()
self.mode = mode
self.mode = mode.lower()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果删除mode=mode.lower(), 后面使用到的mode也需要同步改成self.mode

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是在Web端查看时发现而直接修改的,疏忽了......

另外,关于该文件我有两个注意点:

  1. {train_path, val_path, test_path} 合并成 file_path 是否会更加方便;
  2. 对于 mode='test' ,在之后的 API 中(如 evaluate/predict)均没有使用。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常感谢您的反馈,关于path的问题我们会进行评估哈

self.num_classes = num_classes
self.ignore_index = ignore_index
self.edge = edge

if mode.lower() not in ['train', 'val', 'test']:
if self.mode not in ['train', 'val', 'test']:
raise ValueError(
"mode should be 'train', 'val' or 'test', but got {}.".format(
mode))

if self.transforms is None:
raise ValueError("`transforms` is necessary, but it is None.")

self.dataset_root = dataset_root
if not os.path.exists(self.dataset_root):
raise FileNotFoundError('there is not `dataset_root`: {}.'.format(
self.dataset_root))
Expand Down