Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow 2 #466

Closed
RoboEvangelist opened this issue Nov 10, 2020 · 6 comments
Closed

Tensorflow 2 #466

RoboEvangelist opened this issue Nov 10, 2020 · 6 comments

Comments

@RoboEvangelist
Copy link

Folks,

Will there be any work to make this code Tensorflow 2 compatible?

Thanks,

@MaybeShewill-CV
Copy link
Owner

@RoboEvangelist Will try tf2 when I have enough spare time. No time for that recently:)

@RoboEvangelist
Copy link
Author

I see. If I get any progress on that myself, I'll let you know. Thanks

@MaybeShewill-CV
Copy link
Owner

@RoboEvangelist Welcome:)

@Holzpferd
Copy link

I'm trying to convert the code to tensorflow 2 with the help of the migration tool of Google. I do this because I would like to train the lanenet on RTX 3070, which always has problem with tensorflow 1.x since the cuda version can only be higher than 11.1.
However, there was one problem I couldn't solve. The error message is in the following:

Traceback (most recent call last):
File "E:/Work/02_IntellCar/LaneDetection/fromGithub/lanenet-lane-detection/train_lanenet_tusimple.py", line 40, in
train_model()
File "E:/Work/02_IntellCar/LaneDetection/fromGithub/lanenet-lane-detection/train_lanenet_tusimple.py", line 30, in train_model
worker = single_gpu_trainner.LaneNetTusimpleTrainer()
File "E:\Work\02_IntellCar\LaneDetection\fromGithub\lanenet-lane-detection\trainner\tusimple_lanenet_single_gpu_trainner.py", line 81, in init
self._train_dataset.next_batch(batch_size=self._batch_size)
File "E:\Work\02_IntellCar\LaneDetection\fromGithub\lanenet-lane-detection\data_provider\lanenet_data_feed_pipline.py", line 312, in next_batch
return iterator.get_next(name='{:s}_IteratorGetNext'.format(self._dataset_flags))
TypeError: get_next() got an unexpected keyword argument 'name'

I didn't have this problem with tensorflow 1.14.0. And I haven't seen anywhere this usage with make_one_shot_iterator.get_next(). Mostly, there is no argument inside the get_next().

Can anyone help me with this problem? Many thanks in advance!

@MaybeShewill-CV
Copy link
Owner

@Holzpferd Must be tf version problem. You may adjust the code according to your local tf's api:)

@YuhengHuang42
Copy link

I'm trying to convert the code to tensorflow 2 with the help of the migration tool of Google. I do this because I would like to train the lanenet on RTX 3070, which always has problem with tensorflow 1.x since the cuda version can only be higher than 11.1. However, there was one problem I couldn't solve. The error message is in the following:

Traceback (most recent call last): File "E:/Work/02_IntellCar/LaneDetection/fromGithub/lanenet-lane-detection/train_lanenet_tusimple.py", line 40, in train_model() File "E:/Work/02_IntellCar/LaneDetection/fromGithub/lanenet-lane-detection/train_lanenet_tusimple.py", line 30, in train_model worker = single_gpu_trainner.LaneNetTusimpleTrainer() File "E:\Work\02_IntellCar\LaneDetection\fromGithub\lanenet-lane-detection\trainner\tusimple_lanenet_single_gpu_trainner.py", line 81, in init self._train_dataset.next_batch(batch_size=self._batch_size) File "E:\Work\02_IntellCar\LaneDetection\fromGithub\lanenet-lane-detection\data_provider\lanenet_data_feed_pipline.py", line 312, in next_batch return iterator.get_next(name='{:s}_IteratorGetNext'.format(self._dataset_flags)) TypeError: get_next() got an unexpected keyword argument 'name'

I didn't have this problem with tensorflow 1.14.0. And I haven't seen anywhere this usage with make_one_shot_iterator.get_next(). Mostly, there is no argument inside the get_next().

Can anyone help me with this problem? Many thanks in advance!

It is OK to ignore the name parameter in the function. And for those who wish to use TensorFlow 2 to train the model, you can simply disable the TensorFlow 2 behavior by:

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

Then it is compatible for you to run the training code directly under TensorFlow2-GPU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants