Comments (12)
@yakubota 1. I did not annotate images by my own. The cityscapes dataset have well annotated images. If you do not know how to generated the annotated images you refer to https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/preparation/createTrainIdLabelImgs.py or https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/preparation/json2labelImg.py which may help you. 2. As for the error you mentioned here make sure you have correctly generate the training images and their corresponding lable images first. Then use the tool https://github.com/MaybeShewill-CV/bisenetv2-tensorflow/blob/master/data/example_dataset/cityscapes/image_file_index/make_image_file_index.py to generate the training index file. Finally make sure you have set the dataset dir path in cityscapes_bisenetv2.yaml file properly:)
from bisenetv2-tensorflow.
Thank you for your thoughtful response.
I don't know how to properly set the DATA_DIR path.
Currently, the folder with the datasets is as follows. Where should I set the DATA_DIR path?
I specified the absolute path for the location surrounded by the red frame, but it didn't work.
I confirmed that there is no problem in the correspondence between the training image and the annotated image.
from bisenetv2-tensorflow.
@yakubota Eg. The DATA_DIR: "REPO_ROOT_DIR/data/example_dataset/cityscapes" :)
from bisenetv2-tensorflow.
I specified the absolute path above and got the same error.
Is this due to the fact that there are only 8 images each of train, test and val in the sample data?
from bisenetv2-tensorflow.
@yakubota The image in data folder is just a sample. You'd better use the whole complete Cityscapes dataset to train the model:)
from bisenetv2-tensorflow.
@yakubota The error you mentioned above refer to a shape mismatch problem. The decode image should have size (2048, 1024) which is the origin image shape in cityscapes dataset. But it seems that the input tensor shape which you put in is with size of (1024, 256). You may check if there is something wrong during your processing:)
from bisenetv2-tensorflow.
The image is sample data, the program has changed only the path specifies of "REPO_ROOT_DIR/config/cityscapes/cityscapes_bisenetv2.yaml".
However, I got the following error. If you know the cause, please help me.
Error:
2020-07-06 19:36:13.516 | INFO | trainner.cityscapes.cityscapes_bisenetv2_multi_gpu_trainner:train:379 - => Starts to train BiseNetV2 from scratch ...
0it [00:00, ?it/s]
C:\Users\students\anaconda3\envs\seg\lib\site-packages\numpy\core\fromnumeric.py:3335: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
C:\Users\students\anaconda3\envs\seg\lib\site-packages\numpy\core_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
0%| | 0/1 [00:00<?, ?it/s]Traceback (most recent call last):
File "C:\Users\students\anaconda3\envs\seg\lib\site-packages\tensorflow\python\client\session.py", line 1356, in _do_call
return fn(*args)
File "C:\Users\students\anaconda3\envs\seg\lib\site-packages\tensorflow\python\client\session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:\Users\students\anaconda3\envs\seg\lib\site-packages\tensorflow\python\client\session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 2097152 values, but the requested shape has 262144
[[{{node Reshape_1}}]]
[[graph_input_node/val_IteratorGetNext]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/cityscapes/train_bisenetv2_cityscapes.py", line 40, in
train_model()
File "tools/cityscapes/train_bisenetv2_cityscapes.py", line 32, in train_model
worker.train()
File "C:\Users\students\Desktop\bisenetv2-tensorflow-master\tools\cityscapes\trainner\cityscapes\cityscapes_bisenetv2_multi_gpu_trainner.py", line 432, in train
self._val_loss, self._val_global_step
File "C:\Users\students\anaconda3\envs\seg\lib\site-packages\tensorflow\python\client\session.py", line 950, in run
run_metadata_ptr)
File "C:\Users\students\anaconda3\envs\seg\lib\site-packages\tensorflow\python\client\session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\students\anaconda3\envs\seg\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _do_run
run_metadata)
File "C:\Users\students\anaconda3\envs\seg\lib\site-packages\tensorflow\python\client\session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 2097152 values, but the requested shape has 262144
[[{{node Reshape_1}}]]
[[graph_input_node/val_IteratorGetNext]]
from bisenetv2-tensorflow.
@yakubota ==! Still you have wrongly setup your config file. The REPO_ROOT_DIR should be your repo's root dir eg. D:\lanenet-detection-master rather than "REPO_ROOT_DIR". Please paste your config yaml file here and make sure you have successfully generated the tfrecords. Your problem was not that hard to solve if you have a little knowledge about what you did here:)
from bisenetv2-tensorflow.
tfrecords has been successfully generated.
The DATA_DIR, TEST_FILE_LIST, TRAIN_FILE_LIST and VAL_FILE_LIST specified in that file "cityscapes_bisenetv2.yaml"" are as follows.
Can you tell me what is wrong with it?
DATA_DIR: 'C:\Users\students\Desktop\bisenetv2-tensorflow-master\data\example_dataset\cityscapes'
TEST_FILE_LIST: 'C:\Users\students\Desktop\bisenetv2-tensorflow-master\data\example_dataset\cityscapes/image_file_index/test.txt'
TRAIN_FILE_LIST: 'C:\Users\students\Desktop\bisenetv2-tensorflow-master\data\example_dataset\cityscapes/image_file_index/train.txt'
VAL_FILE_LIST: 'C:\Users\students\Desktop\bisenetv2-tensorflow-master\data\example_dataset\cityscapes/image_file_index/val.txt'
from bisenetv2-tensorflow.
@yakubota I have tested it on my local machine. Nothing wrong happened. I did not know how you reach the problem. You'd better check if there are any problems with image shape during your process. And still I recommend you to use the whole cityscapes dataset to train. The config yaml file was made for the whole cityscapes dataset rather than the toy example instead. Good luck :)
from bisenetv2-tensorflow.
Thank you for all your research.
I downloaded the dataset from cityscapes and revalidated it, but the results were no good.
I try to find the cause.
When executing tools/cityscapes/train_bisenetv2_ cityscapes.py, CUDA_VISIBLE_DEVICES="0, 1, 2, 3" in README.md is not required?
Here's the execution I'm typing in
python tools/cityscapes/train_bisenetv2_ cityscapes.py
from bisenetv2-tensorflow.
@yakubota If you have four gpus and intend to use all of them you do not have to set CUDA_VISIBLE_DEVICES="0, 1, 2, 3". CUDA_VISIBLE_DEVICES="0, 1, 2, 3" was used to specify certain some of your gpus which you want to use otherwise tensorflow will allocate all of them instead:)
from bisenetv2-tensorflow.
Related Issues (20)
- Issue when resuming training HOT 3
- 您好,您有coco的预训练模型吗? HOT 1
- 这项目结构真的牛,佩服!!! HOT 1
- inference time HOT 9
- retrain issue with CityScapes HOT 5
- inference time HOT 4
- 请教一下为什么训练时GPU使用率才百分之几 HOT 3
- 训练时,Train loss: nan Train miou: nan HOT 3
- 请问怎么使用使用 v2 large方式训练 HOT 3
- 为什么训练中会出现 Train loss: 3.29611 Val loss:nan... val loss 怎么运算出了 nan HOT 3
- 是不是对一些细小的识别不太好,或是需要做哪些方面的优化 HOT 3
- 关于cityscapes预训练模型的checkpoint文件 HOT 9
- Could you share your released bisenetv2 model in baidu or google cloud? HOT 3
- Data augmentation and data shuffling problem? HOT 3
- Quantized Model? HOT 3
- 请教模型几个参数的作用 HOT 1
- 针对小目标的识别分割应该从哪里下手优化
- the loss is always nan HOT 1
- Performance issues in /data_provider (by P3) HOT 1
- 你好 我无法解决这个问题 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 bisenetv2-tensorflow.