tusimple / tusimple-duc Goto Github PK
View Code? Open in Web Editor NEWUnderstanding Convolution for Semantic Segmentation
Home Page: https://arxiv.org/abs/1702.08502
License: Apache License 2.0
Understanding Convolution for Semantic Segmentation
Home Page: https://arxiv.org/abs/1702.08502
License: Apache License 2.0
In the link to the models (https://drive.google.com/drive/folders/0B72xLTlRb0SoREhISlhibFZTRmM), I can only find the segmentation pretrained models. Would you please tell me where can I find the classification model pretrained on ImageNet?
Afer I run the following code , the network can not be trainned.
python train_model.py ../configs/train/train_cityscapes.cfg
shown as following:
sipl@sipl:/lyx/TuSimple-DUC/train$ /usr/bin/python train_model.py ../configs/train/train_cityscapes.cfg/lyx/TuSimple-DUC/train$
[19:35:52] src/nnvm/legacy_json_util.cc:153: Loading symbol saved by previous version v0.8.0. Attempting to upgrade...
sipl@sipl:
Hello,first of allThanks for all the effort you have made for the segmentation. During the testing procedure, I have met some problems. When I build the repository, after executing make command , the terminal gives the tips 'can not find the '....../ps-lite/make/ps.mk'.Is ther any way to solve this issues?thanks for all
Hi,_ when i use predict_full_image.py , I make my val.lst like this:
/home/xxx/MXnetProjects/TuSimple-DUC/Data/cityscapes/gtFine/test/berlin/berlin_000000_000019_leftImg8bit.png_`
But these is always a error, i debug it and found that this is a error when use im = cv.imread(img_path)[:, :, ::-1] in predict_single, for i set the vla.lst in wrong format.
can you help me.
THANKS!
If so, does your open MXNet support it?
Hi,
I'm trying to run the Cityscapes classifier in test mode on an Amazon EC2 instance, but I'm running into this error:
$ python predict_full_image.py ../configs/test/test_full_image.cfg
[06:22:55] src/nnvm/legacy_json_util.cc:190: Loading symbol saved by previous version v0.8.0. Attempting to upgrade...
[06:22:55] src/nnvm/legacy_json_util.cc:198: Symbol successfully upgraded!
/home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/module/base_module.py:53: UserWarning: You created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
data
seg_loss_label
warnings.warn(msg)
/home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/module/base_module.py:65: UserWarning: Data provided by label_shapes don't match names specified by label_names ([] vs. ['softmax_label'])
warnings.warn(msg)
[06:22:55] /home/ubuntu/TuSimple-DUC/mxnet/dmlc-core/include/dmlc/./logging.h:308: [06:22:55] src/storage/storage.cc:113: Compile with USE_CUDA=1 to enable GPU usage
Stack trace returned 10 entries:
[bt] (0) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(+0x12a7b3a) [0x7f95e0047b3a]
[bt] (1) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet11StorageImpl5AllocEmNS_7ContextE+0x57) [0x7f95e0048317]
[bt] (2) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(+0x131869f) [0x7f95e00b869f]
[bt] (3) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet4exec15ReshapeOrCreateERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN4nnvm6TShapeEiRKNS_7ContextEPSt13unordered_mapIS6_NS_7NDArrayESt4hashIS6_ESt8equal_toIS6_ESaISt4pairIS7_SH_EEE+0xa4f) [0x7f95e00be58f]
[bt] (4) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet4exec13GraphExecutor13InitArgumentsERKN4nnvm12IndexedGraphERKSt6vectorINS2_6TShapeESaIS7_EERKS6_IiSaIiEERKS6_INS_7ContextESaISG_EESK_SK_RKS6_INS_9OpReqTypeESaISL_EERKSt13unordered_setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashISW_ESt8equal_toISW_ESaISW_EEPKNS_8ExecutorEPSt13unordered_mapISW_NS_7NDArrayESY_S10_SaISt4pairIKSW_S19_EEEPS6_IS19_SaIS19_EES1I_S1I_+0xaa4) [0x7f95e00c1f24]
[bt] (5) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet4exec13GraphExecutor4InitEN4nnvm6SymbolERKNS_7ContextERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_St4lessISD_ESaISt4pairIKSD_S4_EEERKSt6vectorIS4_SaIS4_EESR_SR_RKSt13unordered_mapISD_NS2_6TShapeESt4hashISD_ESt8equal_toISD_ESaISG_ISH_ST_EEERKSS_ISD_iSV_SX_SaISG_ISH_iEEERKSN_INS_9OpReqTypeESaIS18_EERKSt13unordered_setISD_SV_SX_SaISD_EEPSN_INS_7NDArrayESaIS1I_EES1L_S1L_PSS_ISD_S1I_SV_SX_SaISG_ISH_S1I_EEEPNS_8ExecutorERKSS_INS2_9NodeEntryES1I_NS2_13NodeEntryHashENS2_14NodeEntryEqualESaISG_IKS1S_S1I_EEE+0x88b) [0x7f95e00c9edb]
[bt] (6) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet8Executor10SimpleBindEN4nnvm6SymbolERKNS_7ContextERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_St4lessISC_ESaISt4pairIKSC_S3_EEERKSt6vectorIS3_SaIS3_EESQ_SQ_RKSt13unordered_mapISC_NS1_6TShapeESt4hashISC_ESt8equal_toISC_ESaISF_ISG_SS_EEERKSR_ISC_iSU_SW_SaISF_ISG_iEEERKSM_INS_9OpReqTypeESaIS17_EERKSt13unordered_setISC_SU_SW_SaISC_EEPSM_INS_7NDArrayESaIS1H_EES1K_S1K_PSR_ISC_S1H_SU_SW_SaISF_ISG_S1H_EEEPS0_+0x233) [0x7f95e00ca583]
[bt] (7) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(MXExecutorSimpleBind+0x2a67) [0x7f95e00888c7]
[bt] (8) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7f9603afae40]
[bt] (9) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x2eb) [0x7f9603afa8ab]
Traceback (most recent call last):
File "predict_full_image.py", line 100, in <module>
tester = ImageListTester(config)
File "predict_full_image.py", line 33, in __init__
self.tester = Tester(self.config)
File "/home/ubuntu/TuSimple-DUC/tusimple_duc/test/tester.py", line 42, in __init__
predictor.bind(data_shapes=[('data', data_shape)], for_training=False)
File "/home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/module/module.py", line 417, in bind
state_names=self._state_names)
File "/home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/module/executor_group.py", line 231, in __init__
self.bind_exec(data_shapes, label_shapes, shared_group)
File "/home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/module/executor_group.py", line 327, in bind_exec
shared_group))
File "/home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/module/executor_group.py", line 603, in _bind_ith_exec
shared_buffer=shared_data_arrays, **input_shapes)
File "/home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/symbol.py", line 1479, in simple_bind
raise RuntimeError(error_msg)
RuntimeError: simple_bind error. Arguments:
data: (1, 3, 1024, 2048)
[06:22:55] src/storage/storage.cc:113: Compile with USE_CUDA=1 to enable GPU usage
Stack trace returned 10 entries:
[bt] (0) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(+0x12a7b3a) [0x7f95e0047b3a]
[bt] (1) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet11StorageImpl5AllocEmNS_7ContextE+0x57) [0x7f95e0048317]
[bt] (2) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(+0x131869f) [0x7f95e00b869f]
[bt] (3) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet4exec15ReshapeOrCreateERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKN4nnvm6TShapeEiRKNS_7ContextEPSt13unordered_mapIS6_NS_7NDArrayESt4hashIS6_ESt8equal_toIS6_ESaISt4pairIS7_SH_EEE+0xa4f) [0x7f95e00be58f]
[bt] (4) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet4exec13GraphExecutor13InitArgumentsERKN4nnvm12IndexedGraphERKSt6vectorINS2_6TShapeESaIS7_EERKS6_IiSaIiEERKS6_INS_7ContextESaISG_EESK_SK_RKS6_INS_9OpReqTypeESaISL_EERKSt13unordered_setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashISW_ESt8equal_toISW_ESaISW_EEPKNS_8ExecutorEPSt13unordered_mapISW_NS_7NDArrayESY_S10_SaISt4pairIKSW_S19_EEEPS6_IS19_SaIS19_EES1I_S1I_+0xaa4) [0x7f95e00c1f24]
[bt] (5) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet4exec13GraphExecutor4InitEN4nnvm6SymbolERKNS_7ContextERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_St4lessISD_ESaISt4pairIKSD_S4_EEERKSt6vectorIS4_SaIS4_EESR_SR_RKSt13unordered_mapISD_NS2_6TShapeESt4hashISD_ESt8equal_toISD_ESaISG_ISH_ST_EEERKSS_ISD_iSV_SX_SaISG_ISH_iEEERKSN_INS_9OpReqTypeESaIS18_EERKSt13unordered_setISD_SV_SX_SaISD_EEPSN_INS_7NDArrayESaIS1I_EES1L_S1L_PSS_ISD_S1I_SV_SX_SaISG_ISH_S1I_EEEPNS_8ExecutorERKSS_INS2_9NodeEntryES1I_NS2_13NodeEntryHashENS2_14NodeEntryEqualESaISG_IKS1S_S1I_EEE+0x88b) [0x7f95e00c9edb]
[bt] (6) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(_ZN5mxnet8Executor10SimpleBindEN4nnvm6SymbolERKNS_7ContextERKSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES3_St4lessISC_ESaISt4pairIKSC_S3_EEERKSt6vectorIS3_SaIS3_EESQ_SQ_RKSt13unordered_mapISC_NS1_6TShapeESt4hashISC_ESt8equal_toISC_ESaISF_ISG_SS_EEERKSR_ISC_iSU_SW_SaISF_ISG_iEEERKSM_INS_9OpReqTypeESaIS17_EERKSt13unordered_setISC_SU_SW_SaISC_EEPSM_INS_7NDArrayESaIS1H_EES1K_S1K_PSR_ISC_S1H_SU_SW_SaISF_ISG_S1H_EEEPS0_+0x233) [0x7f95e00ca583]
[bt] (7) /home/ubuntu/TuSimple-DUC/mxnet/python/mxnet/../../lib/libmxnet.so(MXExecutorSimpleBind+0x2a67) [0x7f95e00888c7]
[bt] (8) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7f9603afae40]
[bt] (9) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x2eb) [0x7f9603afa8ab]
Any idea what is causing it and how to fix it?
System:
Ubuntu 16.04.3
mxnet 0.11.0
numpy 1.13.3
cv2 3.2.0
PIL 1.1.7
cython 0.27.1
Thanks!
I tried to convert the deeplab model in #1, but failed due to error
Message type "caffe.ImageDataParameter" has no field named "label_type"
So would you please share the ImageNet pretrained ResNet-101 Model please?
Thanks
git clone --recursive [email protected]:TuSimple/mxnet.git
Cloning into 'mxnet'...
The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Hi, I feel confused to CRFs. I'm sorry that i can't find the way you apply the CRFs to your ResNet-DUC. Could you please tell me how to do it? Thank you very much!!!!
Hello,I am very interested in your project.But I am a newbie.I have a question to ask for your help.I have installed mxnet_cu90==0.12.1 in anaconda env.and I use ubuntu16.04 ,cuda9.0 and cudnn7.0 .How should I modify the original make/config.mk that you provided? Thanks a lot!
Hi,
Thanks for the effort for making the training code publicly available.
I would like to try training the cityscapes model from scratch by your code. I saw on the paper that you used some data augmentation trick to enlarge the number of training images. Could you provide the augmented data you used and some instruction for generating the data list? Thank you very much!
when I run your code of train_model , there is an error : config_path = sys.argv[1] => list index out of range , what I mistake?
thank you!
Hi! How do you evaluate the VOC 2012 test set? How did you test the segmentation results of VOC2012 test data set on PASCAL VOC official website? Looking forward to your reply. Thanks!
hello,in the paper you have mentioned crf as a post processing procedure,but i couldnt found it on the project,can you provide it
Hi,
I would like to train the network from ImageNet pretrained weights using your network structure and configurations. However, I didn't see the pretrained weights in your provided model folder. Is it possible to provide the ImageNet pretrained weight you used for training from scratch? Thank you so much!
I am trying to understand your pipeline so that I can run it on my own data.
I see a script in data_prep/get_cityscapes_list.py
but I cannot find from your readme how to run it.
Can you please add a description of the expected format and/or document the data prep pipeline?
Thank you
If the orginal image is (600,800), After downsample 16X, the feature map is (37,50), How to use DUC to reproduce orginal size? upsample 16X is (592,800)
Hi, GrassSunFlower,
I try to train the DUC network using the init.param, but the init.param do not contain the aspp weights, so I want to set the different learning rate of aspp to the front layers. I just want to know how to do this in MXNET, can you provide a eaxample. Thanks!
Thanks for your sharing and guidance。
This is my first time to train segmentation network
Now, I use one nvidia-card to train . All parameters is same with provided train.cfg. Only use fine annotation datasets. The pretrained model is init.params . now ,the speed of training is 0.78samples/sec. It take 7.5 hours to train one epoch!
The 152 VOC is consistent but not for 101 Cityscapes one. Could you please fix it?
When I set multi_thread to True in train_cityscapes.cfg, error happens as below:
File "/home/xxx/anaconda2/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/home/xxx/anaconda2/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/home/xxx/TuSimple-DUC/tusimple_duc/core/cityscapes_loader.py", line 83, in _worker
index, image, label = CityLoader._get_single(item, input_args)
ValueError: need more than 2 values to unpack
But when multi_thread is False, no error happens.
Hi,
can resnet DUC backbone network be replaced with mobile network?
Hi, I'm very interested in your work. But when I tried to repeat your experiment, a MXNetError appeared that Cannot find argument 'fix_linear_trans' when loading the ResNet_DUC_HDC_CityScapes-symbol.json. My current environment is Python 2.7, Mxnet version 1.0.0 under Win10. Is this error because of the operating system or the different Mxnet version ?
I have read your papers(Understanding Convolution for semantic segmentation ),and run your net.Then I make an improvement.But When submit my results to pascal voc server,I always get an evaluation error.
I use the command: tar -zcvf results.tgz results.
My directory structure :/results/VOC2012/Segmentation/comp6_test_cls/
The pixel of every image is similar [0,64,128]
Could you give me some point?
Hi, authors,
How much GPU memory is required, in training and prediction, respectively?
Does a 6GB GPU card meet the requirement?
THX!
flake8 testing of https://github.com/TuSimple/TuSimple-DUC on Python 3.6.3
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
./data_prep/get_cityscapes_list.py:18:42: E999 SyntaxError: invalid syntax
print "%d out of %d done." % (index, len(all_images))
^
./test/predict_full_image.py:87:86: E999 SyntaxError: invalid syntax
print 'Process %d out of %d image ... %s, time cost:%.3f, confidence:%.3f' % \
^
2 E999 SyntaxError: invalid syntax
I can't find the resnet152 python network file, but I want to use it in my code, would you please upload it? Thanks a lot.
I tried to use the default 'imglists/train.lst,' but seems format not recognized. Could you please provide the train-list you used? Thanks.
Why the num_filter in the "res1_3 = Conv_BN_AC(data=res1_2, num_filter=128, kernel=(3, 3), name='conv1_3_3x3', suffix='conv1_3_3x3', pad=(1, 1), stride=(1, 1))", which is in the resnet.py, is 128?
I think it may be 64.
hi,I try your DUC method as decoder on my network(similiar to mobile net for high performance),but there are many grid on the predicted alpha. the loss seems normal. could you please figure it out?
The val_args
copys from train_args
while it does not change crop
.
However, the data_grep/get_cityscapes_list.py
offers is_crop
, I think val_bigger_patch.lst
should not be cropped version. So I set is_crop
as False
to produce val_bigger_patch.lst
, and I tried to disable 'crop' in train/solver.py
as below:
val_args = train_args.copy()
val_args['data_shape'] = [(self.batch_size, 3, 1024, 2048)]
val_args['label_shape'] = [
(self.batch_size, 1024 * 2048 / self.cell_width ** 2)]
val_args['scale_factors'] = [1]
val_args['use_random_crop'] = False
val_args['use_mirror'] = False
val_args['crop'] = False
But module.fit
fails and it seems that it complains train_data and val_data is not consistent while their data and label's shape are not same, module is bind to the train_data's shape as below already:
module.bind(
data_shapes=[(self.data_name[0], self.data_shape[0])],
label_shapes=[(self.label_name[0], self.label_shape[0])])
If you use cropped val_bigger_patch.lst actually, then I tried to validate it on full image by myself, or the program may be buggy in validating, it not enouge to fix #16 .
I would like to use your open model to reproduce this evaluation:
ResNet101-DUC-HDC on CityScapes testset (mIoU): 80.1(multiple scale testing )
But I do not know what test_scales
does you use in test_full_image.cfg
, could you tell me? Thank you very much.
Hi! I want retrain this model on VOC2012 dataset, is there any config file or advices?
Thanks a lot!
I find that the 112nd line in solver.py val_args['scale_factors'] = 1
will cause TypeError:
Traceback (most recent call last):
File "./train_model.py", line 16, in <module>
train_end2end()
File "./train_model.py", line 13, in train_end2end
model.fit()
File "/home/acgtyrant/Projects/TuSimple-DUC/train/solver.py", line 235, in fit
num_epoch=self.num_epochs,
File "/home/acgtyrant/Projects/TuSimple-DUC/mxnet/python/mxnet/module/base_module.py", line 528, in fit
batch_end_callback=eval_batch_end_callback, epoch=epoch)
File "/home/acgtyrant/Projects/TuSimple-DUC/mxnet/python/mxnet/module/base_module.py", line 240, in score
for nbatch, eval_batch in enumerate(eval_data):
File "/home/acgtyrant/Projects/TuSimple-DUC/tusimple_duc/core/cityscapes_loader.py", line 133, in next
if self._get_next():
File "/home/acgtyrant/Projects/TuSimple-DUC/tusimple_duc/core/cityscapes_loader.py", line 149, in _get_next
image, label = CityLoader._get_single(self.data[i], self.input_args)
File "/home/acgtyrant/Projects/TuSimple-DUC/tusimple_duc/core/cityscapes_loader.py", line 163, in _get_single
return utils.get_single_image_duc(item, input_args)
File "/home/acgtyrant/Projects/TuSimple-DUC/tusimple_duc/core/utils.py", line 86, in get_single_image_duc
scale_factor = random.choice(scale_factors)
File "/usr/lib/python2.7/random.py", line 275, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
TypeError: object of type 'int' has no len()
I write resnet.symbol by myself and use it as pretrained model to train TuSimple-DUC, and keep cfg consistent with the paper except cropped size. See my fork.
However, train_IoU is only 0.563 while I can not validate temporarily #21 , I think the val_IoU should not be too far away:
01-03 02:23:28 Epoch[19] Train-acc_ignore=0.932954
01-03 02:23:28 Epoch[19] Train-IoU=0.563348
01-03 02:23:28 Epoch[19] Train-SoftmaxLoss=0.212817
01-03 02:23:28 Epoch[19] Time cost=10693.555
01-03 02:23:29 Saved checkpoint to "../models/ResNet_DUC_HDC_CityScapes/2017_12_31_15:19:05/ResNet_DUC_HDC_CityScapes-0020.params"
Anyone reproduce successfully?
ValueError: too many slices.Some splits are empty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.