Comments (12)
It seems that this bug is caused by that you have not specified the bn_type during testing.
@hsfzxjy Please help to check this issue.
from openseg.pytorch.
Hi. It may be caused by using the wrong version of PyTorch. This codebase is currently compatible with PyTorch 0.4.1 (well tested) and not supported by PyTorch 1.3+.
from openseg.pytorch.
Thank you very much, but I have another problem, I find the cityscapes dataset donot contain image or lable folder, it is divided into multiple subfolders according to different city names. what the image or label folder in your code in default_loader.py mean?
Error Message:
Traceback (most recent call last):
File "main.py", line 214, in
model = Tester(configer)
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/segmentor/tester.py", line 69, in init
self._init_model()
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/segmentor/tester.py", line 79, in _init_model
self.test_loader = self.seg_data_loader.get_valloader()
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/lib/datasets/data_loader.py", line 150, in get_valloader
configer=self.configer),
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/lib/datasets/loader/default_loader.py", line 34, in init
self.img_list, self.label_list, self.name_list = self.__list_dirs(root_dir, dataset)
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/lib/datasets/loader/default_loader.py", line 118, in __list_dirs
img_extension = os.listdir(image_dir)[0].split('.')[-1]
FileNotFoundError: [Errno 2] No such file or directory: '/home/dai/code/semantic_segmentation/dataset/cityscape_dataset/val/image'
from openseg.pytorch.
We use a different directory structure. You may use https://github.com/openseg-group/openseg.pytorch/blob/master/lib/datasets/preprocess/cityscapes/cityscapes_generator.py to reorganize data.
from openseg.pytorch.
@hsfzxjy
Thank you verymuch, Could please write a text about how to run your code? There is not any explanation about how to run this code. Thank you very much! Look forward to your instruction!
from openseg.pytorch.
You can try
python cityscapes_generator.py --save_dir /path/to/new_cityscapes_dir --ori_root_dir /path/to/original_cityscapes_dir
where /path/to/original_cityscapes_dir
is the location of original Cityscapes (i.e. containing leftImg8bit) and /path/to/new_cityscapes_dir
is the location containing organized data.
from openseg.pytorch.
@hsfzxjy
Thank you very much, but when i run the command:
python -u main.py --configs configs/cityscapes/H_48_D_4.json --drop_last y --backbone hrnet48 --model_name hrnet_w48_ocr --checkpoints_name hrnet_w48_ocr_1 --phase test --gpu 0 --resume ./checkpoints/cityscapes/hrnet_w48_ocr_1_latest.pth --loss_type fs_auxce_loss --test_dir /home/dai/code/semantic_segmentation/9/openseg.pytorch-master/cityscapes/val/image --out_dir output_images
I got the error:
File "main.py", line 222, in
model.test()
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/segmentor/tester.py", line 131, in test
for j, data_dict in enumerate(self.test_loader):
File "/home/dai/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 336, in next
return self._process_next_batch(batch)
File "/home/dai/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File "/home/dai/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/dai/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/lib/datasets/loader/default_loader.py", line 63, in getitem
img = self.img_transform(img)
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/lib/datasets/tools/transforms.py", line 113, in call
inputs = t(inputs)
File "/home/dai/code/semantic_segmentation/9/openseg.pytorch-master/lib/datasets/tools/transforms.py", line 81, in call
inputs = torch.from_numpy(inputs.transpose(2, 0, 1))
RuntimeError: PyTorch was compiled without NumPy support
I operating environmentis :
anaconda3, python3.7, torch0.4.1, numpy 1.15.0
from openseg.pytorch.
@hsfzxjy
Hi, I solved the above problem, but when I run the code, It just test the cityscapes/val/image with the label, it about 500 images, But how can I test my own images without corresponding labels.
My command:
python -u main.py --configs configs/cityscapes/H_48_D_4.json --drop_last y --backbone hrnet48 --model_name hrnet_w48_ocr --checkpoints_name hrnet_w48_ocr_1 --phase test --gpu 0 --resume ./checkpoints/cityscapes/hrnet_w48_ocr_1_latest.pth --loss_type fs_auxce_loss --test_dir /home/dai/code/semantic_segmentation/9/openseg.pytorch-master/cityscapes/val/image --out_dir output_images
from openseg.pytorch.
@daixiaolei623 Hi. Currently there are no built-in facilities for this. But you can achieve it fast by emulating the directory structure, i.e., organize files like this:
CUSTOM_SET/
val/
image/
img1.png
img2.png
...
label/
img1.png
img2.png
...
where CUSTOM_SET/val/image/
contains your own images, and CUSTOM_SET/val/label/
contains some fake labels. The fake labels are only use to make the dataloader operational, just make sure each image in image/
has a corresponding image file in label/
. For example, you can first create CUSTOM_SET/val/image/
and then create CUSTOM_SET/val/label/
quickly using symlink. After that, simply change the --test_dir
option to the path of your custom dataset.
from openseg.pytorch.
@hsfzxjy
thank you very much, but when I run your code, the performance seems not very good, and I see the performance of your code in cityscapes benchmark is very outstanding, I do not understand why the real performance of my testing of your code with segfix seem not very good, because it is even not equal to the performance of my own code in 2019 which is only ranking 12th in cityscapes benchmark and your code ranking 3th in cityscapes benchmark.
from openseg.pytorch.
@daixiaolei623 Thanks for trying out our SegFix method. Could you provide more details on your usage of our SegFix?
In fact, we believe that our SegFix is capable to improve almost all of the methods that we can find on the Cityscapes leaderboard. @hsfzxjy will help check the problem depending on the more details you can provide.
from openseg.pytorch.
The reason for the original issue (TypeError: 'NoneType' object is not callable
) is that in the ModuleHelper
class there's no default option that would raise an error for not supported Pytorch versions, i.e. it just returns None
.
Namely here.
from openseg.pytorch.
Related Issues (20)
- Address already in use: how to enable multiple training process on one machine?
- validation in inference process has a large difference with validation in train process HOT 1
- ERROR: Found no prediction for ground truth HOT 1
- Wrong! bash scripts/cityscapes/segfix/run_h_48_d_4_segfix.sh segfix_pred_val 1 HOT 1
- Mask loss is 0.0 and overall loss doesnt converge && what is relevance of dt_num_classes ? HOT 2
- TypeError: 'NoneType' object is not callable HOT 2
- Unexpected key(s) in state_dict: "config_dict", "state_dict". HOT 1
- FSSlowOhemCELoss is not defined in loss_helper
- why the refined result is white?
- can not reproduce eval result with segfix
- question about flops
- Result of refinement by SegFix on HRNet / HRNet-Semantic-Segmentation open source
- a pretrained SegFix model,
- preprocess scripts for LIP
- Checkpoints for SegFix models trained with Pytorch-1.7 have been released?
- Preprocess VOC dataset HOT 2
- need *.mat when I want to train segfix on my own dataset
- custom dataset
- label list
- About Train and Val HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openseg.pytorch.