Code Monkey home page Code Monkey logo

Comments (12)

MaybeShewill-CV avatar MaybeShewill-CV commented on May 28, 2024

@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.

hona-p avatar hona-p commented on May 28, 2024

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.
image

from bisenetv2-tensorflow.

MaybeShewill-CV avatar MaybeShewill-CV commented on May 28, 2024

@yakubota Eg. The DATA_DIR: "REPO_ROOT_DIR/data/example_dataset/cityscapes" :)

from bisenetv2-tensorflow.

hona-p avatar hona-p commented on May 28, 2024

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.

MaybeShewill-CV avatar MaybeShewill-CV commented on May 28, 2024

@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.

MaybeShewill-CV avatar MaybeShewill-CV commented on May 28, 2024

@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.

hona-p avatar hona-p commented on May 28, 2024

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]]
image

from bisenetv2-tensorflow.

MaybeShewill-CV avatar MaybeShewill-CV commented on May 28, 2024

@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.

hona-p avatar hona-p commented on May 28, 2024

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'

image

from bisenetv2-tensorflow.

MaybeShewill-CV avatar MaybeShewill-CV commented on May 28, 2024

@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.

hona-p avatar hona-p commented on May 28, 2024

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.

MaybeShewill-CV avatar MaybeShewill-CV commented on May 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.