82,096 questions
Score of 1
1 answer
143 views
Why does tf.function retrace when only the RaggedTensor row-splits dtype changes?
I am passing two equivalent RaggedTensor objects to a function:
import tensorflow as tf
@tf.function(reduce_retracing=True)
def row_sum(x):
print("Tracing")
return tf.reduce_sum(x, ...
Score of -3
1 answer
89 views
How to correctly apply causal masking in Keras Multi-Head Attention for multi-step time series forecasting? [closed]
I am building a Transformer-based model in TensorFlow/Keras to predict river discharge multiple steps ahead using historical climate data (precipitation, temperature).
Since it’s a multi-step ...
Score of 0
1 answer
65 views
Tensorflow lite uses all of my flash (Seeeduino)
I'm compiling on a Seeed studio XIAO SAMD21 and trying to reproduce something like what is being done here: https://wiki.seeedstudio.com/XIAO-BLE-Sense-TFLite-Getting-Started/
TL;DR (training a small ...
Score of 0
2 answers
119 views
CNN digit recognition model: high local accuracy but poor predictions after deployment (Flask API)
I trained a CNN on MNIST for digit recognition that gets ~98% accuracy during local testing (Jupyter/Colab). After deploying it behind a Flask API (React frontend sends canvas-drawn digit images), ...
Advice
0
votes
1
replies
102
views
Should I learn TensorFlow in parallel while taking Andrew Ng's Machine Learning course?
I'm currently taking Andrew Ng's Machine Learning course and have completed the supervised machine learning section. I want to build a strong understanding of machine learning concepts, but I'm also ...
Score of 0
1 answer
95 views
How to use `class_weights` for the validation data when fitting a tensorflow model
I am training a tensorflow model and want to use class_weight for evaluating both the training batches and the validation batches. However, I am only able to use the weights with the training data. ...
Best practices
0
votes
1
replies
75
views
what are minimum image per class requied for max efficiency for efficientnet-lite0 and mobilenetv2 models
I am working on an image classification project for plant disease detection using transfer learning models such as MobileNetV2 and EfficientNetLite. My datasets include 11 classes for maize diseases ...
Score of 0
0 answers
178 views
Running Inference on CPU and C++ using LiteRT
Problem:
I have two outputs, out_buffers.size() == 2 but when I read the data in the second tensor output_buffers[1] the data is rubbish. The first tensor, output_buffers[0] gives the same output as ...
Tooling
0
votes
0
replies
80
views
Best pre-trained vision model for multi-plant disease detection in async web back-end
I'm building a web app with FastAPI + async/await Python backend. Users upload leaf photos via API and the server should return: 1) plant species, 2) disease label or "healthy".
Constraints:
...
Advice
0
votes
1
replies
98
views
Why is it so difficult to train an accuracte GAN model?
I'm trying to train a GAN model, but its results are very bad. The Generator doesn't seem to work. Can someone suggest how this can be improved? What is the best way to remember the code? Can this ...
Advice
1
vote
0
replies
89
views
How to visualize the convolution layer of a CNN?
While working on a CNN model, I got confused.
My questions are:
Is visualizing RGB convolution filters by permuting from (out,in,h,w) to (h,w,in) the correct approach?
Is normalizing all filters ...
Score of 1
2 answers
155 views
TensorFlow tf.data.Dataset.map() becomes slower after adding a Python function
I am using tf.data.Dataset to pre-process data. When I use TensorFlow operations inside map(), the pipeline runs fast. But, after adding a small custom Python function inside map(), training becomes ...
Advice
0
votes
1
replies
54
views
How to integrate CNN model with Flutter app for plant disease detection - API vs TFLite?
I'm building a Flutter app for rice leaf disease detection using CNN as my thesis project.
I'm confused about the best architecture:
Option 1: Deploy CNN model as REST API (Python Flask/FastAPI), ...
Score of 0
1 answer
84 views
Issue when loading model with hub.KerasLayer layer... NameError: Exception encountered when calling Lambda.call()
I am doing some NLP exercises. I am unable to use a saved model with a hub.KerasLayer layer :(
Here are the steps I done:
Create the model - OK
Compile the model - OK
Fit/Train the model - OK
...
Advice
3
votes
6
replies
255
views
How Do Machine Learning Algorithms Improve Accuracy Over Time?
I recently started learning Python and machine learning. I noticed that many developers use libraries like TensorFlow and Scikit-learn for predictive modeling. What are the main advantages of using ...