Giter VIP home page Giter VIP logo

Comments (13)

wr0112358 avatar wr0112358 commented on August 16, 2024 3

The batch_size problem with tf 2.4 is the result of a change in the huber loss function:
https://github.com/tensorflow/tensorflow/blob/v2.4.0/tensorflow/python/keras/losses.py#L1426
https://github.com/tensorflow/tensorflow/blob/v2.0.0/tensorflow/python/keras/losses.py#L885

tf2.0:

tf.losses.Huber(reduction=tf.losses.Reduction.NONE)(tf.ones(shape=(2,16500,4)),tf.ones(shape=(2,16500,4))).shape
TensorShape([2, 16500, 4])

tf 2.4:

tf.losses.Huber(reduction=tf.losses.Reduction.NONE)(tf.ones(shape=(2,16500,4)),tf.ones(shape=(2,16500,4))).shape
TensorShape([2, 16500])

Fixing the bug for tf 2.4 is easy: Remove the additional reduce_sum in the reg_loss in line 218.
https://github.com/FurkanOM/tf-faster-rcnn/blob/master/utils/train_utils.py#L218

from tf-faster-rcnn.

oygenvalue avatar oygenvalue commented on August 16, 2024

Are you doing this without modifying anything or are you trying to implement your own code?

from tf-faster-rcnn.

SalehShmali avatar SalehShmali commented on August 16, 2024

without modifying anything

from tf-faster-rcnn.

FurkanOM avatar FurkanOM commented on August 16, 2024

Probably tf version mismatch, try tf 2.0 not others.

from tf-faster-rcnn.

SalehShmali avatar SalehShmali commented on August 16, 2024

my tf version is 2.3.1 is that mismatch and i am working with cpu not gpu??

from tf-faster-rcnn.

oygenvalue avatar oygenvalue commented on August 16, 2024

from tf-faster-rcnn.

oygenvalue avatar oygenvalue commented on August 16, 2024

from tf-faster-rcnn.

SalehShmali avatar SalehShmali commented on August 16, 2024

i tried on tf2.0 it was aproblems on tensorflow datasets like this :
google.protobuf.json_format.ParseError: Message type "tensorflow_datasets.DatasetInfo" has no field named "downloadSize".
Available Fields(except extensions): ['name', 'description', 'version', 'citation', 'sizeInBytes', 'location', 'downloadChecksums', 'schema', 'splits', 'supervisedKeys', 'redistributionInfo']

from tf-faster-rcnn.

SalehShmali avatar SalehShmali commented on August 16, 2024

what version of tfds is suitable?

from tf-faster-rcnn.

colindecourt avatar colindecourt commented on August 16, 2024

Hi,
Using a batch size of 1 I resolved with this issue. I'm looking to make it work with batch size > 1. I'll let you know if I figured out how to make it work for batch size > 1. I'm using tf 2.4.

from tf-faster-rcnn.

ruman1609 avatar ruman1609 commented on August 16, 2024

Anyone know with Tensorflow 2.8.0, seems the error now change to

ValueError: in user code:    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1021, in train_function  *        return step_function(self, iterator)    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1010, in step_function  **        outputs = model.distribute_strategy.run(run_step, args=(data,))    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1000, in run_step  **        outputs = model.train_step(data)    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 861, in train_step        self._validate_target_and_loss(y, loss)    File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 819, in _validate_target_and_loss        'Target data is missing. Your model was compiled with '    ValueError: Target data is missing. Your model was compiled with loss=ListWrapper([None, None, None, None, None, None, None, None, None]), and therefore expects target data to be provided in 'fit()'

from tf-faster-rcnn.

colindecourt avatar colindecourt commented on August 16, 2024

Hi @ruman1609,
Try the solution I proposed in #17 by changing the format of inputs and targets. It seems you don't give target data to the fit function. Otherwise, downgrade your tf version.

from tf-faster-rcnn.

ruman1609 avatar ruman1609 commented on August 16, 2024

Hi @colindecourt I already do like you do, and like @wr0112358 did. Still the error occurred so right now I using 2.1.0 version. The error log was just like I sent before is using TF 2.8.0. That's why I downgrade my TF to 2.1.0

from tf-faster-rcnn.

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.