82,140 questions
0
votes
0
answers
36
views
Custom PyEnvironment time_step and time_step_spec do not match
I'm creating a custom PyEnvironment in TensorFlow Agents to simulate the track and field decathlon. I've managed to create a functioning environment in the sense that I can use _step and _reset, but ...
Advice
1
vote
4
replies
88
views
Can I create a layer in Keras that de-scales my output?
I am working on a keras regression network that takes about 60 input variables and outputs 35 variables. For both the input and output, about half of the variables are in the range of ±10, while the ...
-2
votes
0
answers
49
views
Why are ReLU-based activations commonly used to approximate functions instead of arbitrary nonlinear functions? [closed]
I’m trying to understand function approximation in neural networks.
When we say that a neural network with ReLU activations can approximate a given equation/function, we often justify it by showing ...
Best practices
0
votes
7
replies
86
views
Which is the best way to detect lines in historically book pages
I am working on an OCR project and need to create a dataset consisting of approximately 1247 pages from 6 books. I need to crop the images line by line and transcribe the text for training a model. ...
Advice
0
votes
0
replies
87
views
Built a Continued Pretraining + Fine-Tuning pipeline for a Veterinary Drug LLM on BioGPT-Large — Looking for feedback on my approach
I've been working on adapting Microsoft's BioGPT-Large for veterinary pharmacology using Plumb's Veterinary Drug Handbook (2023) as my domain corpus. After going through a lot of trial and error, I ...
-2
votes
0
answers
91
views
Converting .h5 model weights (no architecture) to .pth
I have an .h5 file that contains only model weights, not the model architecture. I want to use these weights in a PyTorch model and convert them into a .pth file.
Some context:
The .h5 file does not ...
1
vote
1
answer
153
views
ValueError: shapes mismatch when combining Re-ID Cosine distance and IoU matrices for custom MOT tracking
I am building a custom Multi-Object Tracking (MOT) system using Python, OpenCV, and TensorFlow. My goal is to track people and perform real-time clothing recognition. To prevent ID switches when a ...
Advice
0
votes
2
replies
62
views
How to correctly extract the CLS token from a Keras Hub ViT backbone, and clarify preprocessor usage and pretraining dataset?
I’m working with a Vision Transformer (ViT) backbone from Keras Hub and building my own classification head. My code looks like this:
python
def get_vit_model(model_variant='vit_base',
...
1
vote
2
answers
94
views
Input 'y' of 'Sub' Op has type float16 that does not match type float32 of argument 'x' when using mixed precision with custom loss
I am experimenting with mixed precision training in TensorFlow to speed up training on a GPU. I enabled the global mixed precision policy and implemented a custom loss function. However, when training ...
0
votes
1
answer
64
views
Building tensorflow ambiguity errors
I'm building tensorflow 2.20.0 from source from official repo (from release branch v2.20.0)
with rocm and -march=native
I use:
export HERMETIC_PYTHON_VERSION=3.13
export ROCM_PATH=/opt/rocm/
export ...
Advice
0
votes
2
replies
112
views
How initializing weights with large value causes vanishing gradient problem in neural network
I was watching this tutorial on weight initialization in neural network, and im not able to understand this statement:
In case of Tanh, Sigmoid activation, If we initialize weights with large values (...
2
votes
1
answer
95
views
Tensorflow Keras CV tutorials incorrectly working [closed]
I'm starting learning Machine Learning by Tensorflow Keras CV tutorials and two of my tutorial projects are not working correctly.
I use these tutorials:
https://www.tensorflow.org/tutorials/load_data/...
Tooling
0
votes
7
replies
745
views
How can I install Python 3.11 in windows for Tensorflow
I saw that it is recommended to use this version of python for tensorflow, but I am unable to download it for windows since the page no longer has an installer and the only "installer" I can ...
2
votes
0
answers
105
views
How to solve a checksum error with tfds.load
I'm trying to learn how to use Transformers with TensorFlow and I'm following this tutorial on the TensorFlow website:
https://www.tensorflow.org/text/tutorials/transformer
The problem I have is when ...
3
votes
1
answer
78
views
Keras ImageDataGenerator width_shift_range moving vertically despite correct input shape (H, W, C)
I am experiencing a very strange issue with Keras ImageDataGenerator.
I have a landscape image with shape (1056, 2000, 3).
Height (Axis 0): 1056
Width (Axis 1): 2000
When I use plt.imshow(), the ...