Comments (13)
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.
Are you doing this without modifying anything or are you trying to implement your own code?
from tf-faster-rcnn.
without modifying anything
from tf-faster-rcnn.
Probably tf version mismatch, try tf 2.0 not others.
from tf-faster-rcnn.
my tf version is 2.3.1 is that mismatch and i am working with cpu not gpu??
from tf-faster-rcnn.
from tf-faster-rcnn.
from tf-faster-rcnn.
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.
what version of tfds is suitable?
from tf-faster-rcnn.
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.
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.
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.
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)
- HOW to train my own dataset? HOT 1
- ValueError: Dimension 2 in both shapes must be equal, but are 4 and 1. Shapes are [?,1500,4] and [?,1500,1]. for '{{node roi_deltas/Select_1}} = Select[T=DT_FLOAT](roi_deltas/ExpandDims_9, roi_deltas/GatherV2_1, roi_deltas/zeros_like_1)' with input shapes: [?,1500,1], [?,1500,4], [?,1500,4].
- No such file or directory
- Training strategy HOT 1
- 请问作者,voc2007和voc2012数据集训练时是怎么存放的?
- 怎么指定自己的VOC数据集
- ValueError: The two structures don't have the same sequence length. Input structure has length 0, while shallow structure has length 9. HOT 3
- Is there a trained checkpoint or weight h5 file?
- Question about epochs and learning rate selection
- Predict Error HOT 1
- Data Request
- variances in train_utils.py
- Bounding box resizing in preprocessing??
- Error occurred when finalizing GeneratorDataset iterator
- 数据集下载 HOT 3
- ValueError: The two structures don't have the same sequence length. Input structure has length 0, while shallow structure has length 9. HOT 3
- ValueError: The two structures don't have the same sequence length. Input structure has length 0, while shallow structure has length 9. HOT 1
- Does it support multi-GPU training? HOT 1
- ValueError: Dimension 2 in both shapes must be equal, but are 4 and 1. Shapes are [?,1500,4] and [?,1500,1]. for 'roi_deltas/Select' (op: 'Select') with input shapes: [?,1500,1], [?,1500,4], [?,1500,4]. 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 tf-faster-rcnn.