text
stringlengths 0
23.7k
| label
stringclasses 4
values | dataType
stringclasses 2
values | communityName
stringclasses 4
values | datetime
stringclasses 95
values |
---|---|---|---|---|
That's okay. You can make it faster by removing the intermediate node server. Or by eliminating Flask server by using tensorflowjs for predicting (Personally, I haven't used tfjs. Idk how difficult this is)
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-26-05
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-26-05
|
|
[https://arxiv.org/abs/1911.05722](https://arxiv.org/abs/1911.05722)
This is a published paper named
"Momentum Contrast for Unsupervised Visual Representation Learning"
[https://github.com/facebookresearch/moco](https://github.com/facebookresearch/moco)
this is the official code for the same with a license (code in pytorch i am more familiar with tensorflow)
[https://github.com/PaperCodeReview/MoCo-TF/tree/master?tab=readme-ov-file](https://github.com/PaperCodeReview/MoCo-TF/tree/master?tab=readme-ov-file)
this is an unofficial implementation of the same exact paper MoCo v1 and v2 as they call it in tensorflow
A: I want to implement a self-supervised network using contrastive and reconstruction losses as my project
more or less inside 3 days or so
B: In both the cases (official implementation and unofficial) Resnet is used ; Now to complete the project ASAP and claim it mine can I use efficientnet with a few changes ; would that work??
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-27-05
|
Found [17 relevant code implementations](https://www.catalyzex.com/paper/arxiv:1911.05722/code) for "Momentum Contrast for Unsupervised Visual Representation Learning".
If you have code to share with the community, please add it [here](https://www.catalyzex.com/add_code?paper_url=https://arxiv.org/abs/1911.05722&title=Momentum+Contrast+for+Unsupervised+Visual+Representation+Learning) 😊🙏
--
To opt out from receiving code links, DM me.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-27-05
|
I am a researcher, trying to use Aspect Based Sentiment Analysis for a project. While my code seems proper, along with the GPU setup for Tensorflow on Windows, I keep running into OOM issues. I am using this lib (https://github.com/ScalaConsultants/Aspect-Based-Sentiment-Analysis) to perform the analysis.
The hugging face model I was initially using was the default in the library. Then, I realised the model might be a bit too much for my measely 8GB RTX 4060 (laptop) graphic card, so I tried 'absa/classifier-rest-0.2'. However, the issue remains.
Since I will be running this again and again, with over 400,000 comments, I prefer not to spend a week+ using CPU Tensorflow when GPU enabled Tensorflow is estimated to deal with it within a day.
I am at my wits end and seeking any and all help.
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-28-05
|
A good place to start would be simply reducing the dataset size. Try to run with first 1000 only, if it works on that. Then surely it's an oom issue.
Although, these kind of oom issues can be solved as well.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-28-05
|
Thanks for your response!
I get the error around 70 comments at a time. Should I process the script in a manner that it only works on 70 iterations at a time and run it again and again, 70 comments at a time?
I tried ways to essentially "flush" the model and load again but that, too, failed.
How may I address these oom issues?
Edit: I cannot reduce my dataset as I am not training the model, merely running it for inferences to be used for the research later.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-28-05
|
In that case, if you could share your codes that would be great.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
Im not sure if there is something similar to batch size when training or fine tuning cnns, lowering that number will take fewer samples per step and takes up less memory in your gpu and solves OOM errors
It will however take more steps to have the same convergence rate as with higher batch size
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
Here is the script I am trying to run:
[https://gist.github.com/sannidhyas/1ca379a193d65e6788b30fcd2726ec45](https://gist.github.com/sannidhyas/1ca379a193d65e6788b30fcd2726ec45)
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
I am reading [https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/micro\_speech/train/train\_micro\_speech\_model.ipynb](https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb) and I have no idea how do I train the model with my preferred words, nor do I have idea what is "**Runtime -> Change runtime type**" - are those some browser settings or what? Where do I type commands such as "import tensorflow as tf"...
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-29-05
|
I see you've posted a GitHub link to a Jupyter Notebook! GitHub doesn't
render large Jupyter Notebooks, so just in case, here is an
[nbviewer](https://nbviewer.jupyter.org/) link to the notebook:
https://nbviewer.jupyter.org/url/github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb
Want to run the code yourself? Here is a [binder](https://mybinder.org/)
link to start your own Jupyter server and try it out!
https://mybinder.org/v2/gh/tensorflow/tflite-micro/main?filepath=tensorflow%2Flite%2Fmicro%2Fexamples%2Fmicro_speech%2Ftrain%2Ftrain_micro_speech_model.ipynb
------
^(I am a bot.)
[^(Feedback)](https://www.reddit.com/message/compose/?to=jd_paton) ^(|)
[^(GitHub)](https://github.com/JohnPaton/nbviewerbot) ^(|)
[^(Author)](https://johnpaton.net/)
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
bot dude, I have no idea what are those links
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
ESP doesn't even have that much memory to store the model, and doesn't have that much computational power to infer it as well. But you can run some really small models there. So you may want to train it in a powerful device, and then move the weight to esp and run it.
And there is one more way, which is the easiest of them all. Simply create a model, host it somewhere and call it using Rest API.
That's all
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
I like offline stuff, using Rest API is something I love to avoid in embedded systems, where possible :)
If I understood the selling point well, TensorFlow Lite [https://www.tensorflow.org/lite/microcontrollers](https://www.tensorflow.org/lite/microcontrollers) should be able to run really small models on ESP32, I just want to find the streamlined way to do all this, for a complete noob like me :)
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-30-05
|
Someone help me with running this code on colab
[https://github.com/neouyghur/SESS?utm\_source=catalyzex.com](https://github.com/neouyghur/SESS?utm_source=catalyzex.com)
in the demo.ipynb file there are functions imported from different folders
for ex:
from utils import load\_image
where utils is a folder and load\_image is a function written in [loadimage.py](https://loadimage.py) stored in utils
but colab always outputs module not found : utils even though i have all the folders on my drive
jsut tell me the right way to do this
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-29-05
|
How do i convert a large scale multiple file project written in torch to tensorflow (if that is somehow possible apart from maybe chatgpt)?? Any ideas , starters??
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-29-05
|
ChatGPT can handle it if you prompt it file by file, or put relevant files in one prompt without overshooting the context window limit. I have done this for conversion from pytorch to tensorflow in order to implement PPO in tensorflow.
I also built a small desktop tool called [16x Prompt](https://prompt.16x.engineer/) to help streamline the process and embed source code into the prompt, that should help you with this.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-30-05
|
Hi there,
I' quite new to tf and I recently ran into a weird issue that I couldn't solve by myself. I have quite basic numeric input data in several columns.
X_train, X_val, y_train, y_val = train_test_split(features_scaled, targets, test_size=0.15, random_state=0)
model = Sequential()
model.add(Dense(128, input_dim=X_train.shape[1], activation='relu'))
model.add(Dense(1, activation='linear'))
model.compile(optimizer='adam', loss='mse', metrics=['mae'])
history = model.fit(X_train, y_train, validation_data=(X_val, y_val), epochs=50, batch_size=32)
For now I only have one target.
Here's what happens: When X_train and y_train contain less than 2200 rows, the model performs well. The moment I add row number 2200, I get the exact same output value for any input.
Here's what I tried so far:
* Checked the data in row 2200. It is fine
* Removed rows 2190-2210 anyway
* Changed the model, epochs, and batch_size
* Changed the ordering of input data
None of these had any effect. Any ideas?
Edit: typo
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-29-05
|
I followed [this](https://www.tensorflow.org/install/pip) guide to install tf with cuda, then I get the error that protobuf does not have [builder.py](http://builder.py) so I just copied and pasted it from [this](https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/builder.py) repo, and then I am still getting the <pic attached error> (all the versions are in the guide) any help would be appreciated...
https://preview.redd.it/72hnzj52oe3d1.png?width=1919&format=png&auto=webp&s=b02fb484a4f1083bb470c756d0a5ef61dd7fc14e
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-29-05
|
if you are going to use windows, use torch.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
I use torch for most of the applications but there is a book-"Hands on ML with sklearn/tf" whose exercises I am currently doing using tf.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
great book! I would set up in colab or linux avoid the pain of trying to use tensorflow in windows they (google/tensorflow) just don't support it anymore. you could try wsl but why swim upstream.
again, my conditional holds. :) Switch operating systems if you are going to use tf.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
> Caution: TensorFlow 2.10 was the last TensorFlow release that supported GPU on native-Windows. Starting with TensorFlow 2.11, you will need to install TensorFlow in WSL2, or install tensorflow or tensorflow-cpu and, optionally, try the TensorFlow-DirectML-Plugin
Read the fine print 🫠
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-29-05
|
Some years ago, Google came up with the ability to voice-type efficiently on Gboard. What they did was to be able to voice type while offline or not requiring the use of the Internet. I would like to know if the Language Models trained (80MB) are open-sourced.
Link: [https://research.google/blog/an-all-neural-on-device-speech-recognizer/](https://research.google/blog/an-all-neural-on-device-speech-recognizer/)
https://i.redd.it/i9yqh29lgh3d1.gif
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-30-05
|
The error you are encountering seems to be related to a bad instruction in the startup assembly file for the STM32WB55RGVx microcontroller. The instruction "b1 main" is likely incorrect. You might need to review this part of the code and correct the instruction. This issue is causing the build process to terminate with an exit code of 2, indicating an incomplete build. Fixing the problematic instruction should help resolve the error.I
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-30-05
|
Hello, everyone. My laptop has an RTX 3060, and I'm working on a bone fracture detection project (my first project). I started training the model with a dataset of approximately 8000 images, and it's taking around 1.5 hours for all the epochs to process. Is this normal even with a GPU, or have I not configured the CUDA drivers properly?
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-30-05
|
how many epochs you choose and the image size? also, you can check use of your gpu memory while training.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-30-05
|
epochs - 12
image size - 373 * 373
batch_size - 50
I've checked the gpu usage and it consumes only 5%
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-31-05
|
Are you using Linux or WSL? Windows isn't supported for GPU acceleration since 2021 afaik
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-31-05
|
debian on dual boot
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-02-06
|
You can check by
python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
Tell me what the output is.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-04-06
|
this worked but the nvidia gpu isn't being used to its full extent (in the task manager) even after specifying "with gpu:"
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-04-06
|
You tried using TensorRT?
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-04-06
|
I am training using a training loop over tensorflow dataset. However the training stops at an arbitrary batch number, different one each time
The loop trains for a while, but gives an error at an **arbitrary** batch and epoch, different everytime. The exact error I get is
InvalidArgumentError: {{function_node __wrapped__Mul_device_/job:localhost/replica:0/task:0/device:GPU:0}} required broadcastable shapes [Op:Mul] name:
which suggests the shapes of the inputs and targets are not being respected through the data pipeline. I use the following structure to create a data pipeline
data_pipeline(idx):
x = data[idx] #read in a given element of a numpy array x = tf.convert_to_tensor(x) ## Perform various manipulations
return x1, x2 #x1 with shape ([240, 132, 1, 2]), x2 with shape ([4086, 2])
def tf_data_pipeline(idx):
[x1,x2] = tf.py_function(func=data_pipeline, inp=[idx], Tout[tf.float32,tf.float32]) x1 = tf.ensure_shape(x1, [240, 132, 1, 2]) x2 = tf.ensure_shape(x2, [4086, 2]) return x1,x2
I then set up the tf.Dataset
batch_size = 32 train = tf.data.Dataset.from_tensor_slices((range(32*800)))
train = train.map(tf_data_pipeline) train = train.batch(batch_size)
Then I set up a traning loop over the tf.Dataset
for epoch in range(epochs):
for step, (x_batch_train, y_batch_train) in enumerate(train):
with tf.GradientTape() as tape:
y_pred = model(x_batch_train)
# Compute the loss value for this minibatch.
loss_value = loss_fn(y_batch_train, y_pred)
# Use the gradient tape to automatically retrieve
# the gradients of the trainable variables with respect to the loss.
grads = tape.gradient(loss_value, dcunet8.trainable_weights)
# Run one step of gradient descent by updating
# the value of the variables to minimize the loss.
model.optimizer.apply_gradients(zip(grads, model.trainable_weights))
The actual failure is happening in the tape.gradient step
Note that I have a custom loss function but I don't think the problem lies there. I can provide more details if needed.
Any help appreciated
Tried tf.ensure\_shape with tf.py\_function, however it did not help
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-31-05
|
Why do you have `model(x_batch)` etc and then its `dcunet8` when you call in gradient tape ?
If thats just a copy/paste mistake, does it run in eager mode ?
Also I can' tell but is your indentation here correct? It looks like you are applying the gradients at the end of the epoch.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
Thanks for pointing out the mistake. It was a copy/paste mistake. You are also right about the indentation. Its a typo, I fixed it.
tf.run\_eagerly is True, but not sure if this code is running eagerly. How do I check?
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
Did you fix the issue ? I think it might be the line where you apply thr gradients ( `optimizer.apply_gradients(zip(grads, vars))`). Its now just `optimizer.apply(grads, vars)`
Yes, i know. It could be better documented especially since its so similar to the old way. 😅
Eager execution means its not running in graph mode - makes it alot easier to debug but its much slower. Error messages get very cryptic in graph mode, which is what is happeneing here imo.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
hmm the traceback suggests that the actual failure is happening in tape.gradient(). It seems I need to use the zip(), its giving me "too many values to unpack" error if I use optimizer.apply\_gradients(grads, vars). If I use optimizer.apply(grads, vars), it tells me that Adam optimizer has no such function apply.
I am using tf version 2.15.0
I am not sure the code is executing eagerly. I was trying to use print statements within my data pipeline functions to try to debug but it was not printing anything.
It is also weird that the failure is happening for an arbitrary batch at an arbitrary epoch, after running successfully through multiple batches and epochs...
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
Ah ok, I don't know then if you are still on 2.15. What keras version are you using? Sometimes there can be weird stuff with that ? I was having so much trouble I just refactored everything for keras 3.
I agree your error is strange, and to me it doesnt seem to be obviously coming from the code you provided. But sometimes these errors are hard to figure out.
As for eager execution maybe it could help if you make the gpu invisible to debug?
Sorry I couldnt really help - ive been there before I know how frustrating it can get ...
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
I was just using it in Colab so I figured it must be using the latest version of tf and keras. Let me check that and make sure its all up to date. Thanks for all the help!
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
I'm facing an ERROR: No matching distribution found for tensorflow-text Jupyter Notebook when I try to install it. In Google Colab when I'm loading tensorflow\_hub, when I install tensorflow-text then tensorflow\_hub does not working & when I install tensorflow\_hub then tensorflow-text not working.
https://preview.redd.it/8on3ndmpo14d1.png?width=2560&format=png&auto=webp&s=6d5b96e5621eb9dc5eb2e17518e591d651a0bb35
https://preview.redd.it/wrtmp7ppo14d1.png?width=2560&format=png&auto=webp&s=bb179eb3ddf1fbe84323333302d1590e3640b1a8
https://preview.redd.it/sdx2x4mpo14d1.png?width=2560&format=png&auto=webp&s=f2b65f31dc9902adecc20474cf551308bc9d20f9
I tried installing tensorflow\_text using pip install tensorflow\_text in both Jupyter Notebook and Google Colab. I expected the library to be imported successfully into my code. Additionally, I experimented with installing specific versions of tensorflow\_text but still encountered the same error.
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-01-06
|
I'm running win11 and new to tensorflow, followed nvidia and tensorflow guide to make sure it's showing and running on GPU:0.
In my code it contains 4 layers, 4 units, finally 1 output. Training set was 700 and run for 100 epochs and results as follows:
Intel gen 13 only 16GB ddr5: 23 seconds
RTX 4060 8GB: 38 seconds
I can imagine why train in cpu is faster than gpu, is that something wrong with my setup or Intel really improved tensorflow capability?
Any advice is welcome. Thanks!
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-02-06
|
model / dataset is too small that the overhead in loading these resources to GPU takes longer
you will notice better performance with larger models (more layers)/ datasets
it is also common to find this remark in getting started tutorials
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-02-06
|
How many parameters does your model have? Try something with at least 1M+ parameters and you should see a significant speed up.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-02-06
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-02-06
|
|
Well, I have been trying to apply quantization aware training on mobileNet and it just seems to give an error stating - "to\_quantize only takes Keras Sequential or Functional Model" and I don't get it. Coz, I checked the type of model that is imported from the library and it is indeed a Keras.src.engine.functional.Functional model. Its weird error to understand. Also, please suggest some alternatives. I want to deploy this model on a Raspberry Pi.
One more thing, I followed the docs on tensorflow lite page about quantization aware training and that's what gave me the above error. Any help is much appreciated. Thanks in advance!
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-03-06
|
Well, I have been trying to apply quantization aware training on mobileNet and it just seems to give an error stating - "to\_quantize only takes Keras Sequential or Functional Model" and I don't get it. Coz, I checked the type of model that is imported from the library and it is indeed a Keras.src.engine.functional.Functional model. Its weird error to understand. Also, please suggest some alternatives. I want to deploy this model on a Raspberry Pi.
One more thing, I followed the docs on tensorflow lite page about quantization aware training and that's what gave me the above error. Any help is much appreciated. Thanks in advance!
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-03-06
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-04-06
|
|
I see you have Python 3.7. Which version of TF do you have?
Check https://www.tensorflow.org/install, the latest TF 2 **only** supports Python 3.8-3.11.
Also, I noticed you are on Winodws...TF 2 no longer supports GPU on Winodws native.
I highly recommend you learn how to setup WSL 2 and docker first...but, learning these two takes a bit of time.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-04-06
|
I have tensorflow 1.14.0. Now I updated to T 2.4.0 now its working. thank you david. I try wsl 2 and docker
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-04-06
|
Hey guys I wanna install tensorflow version 1.15.5 on anaconda but anaconda can't find any version earlier than 2
Do you have a way to install ?
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-04-06
|
Linux or windows? And with GPU support?
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-07-06
|
conda create -n tf python=3.6
conda activate tf
conda config --add channels conda-forge
conda config --set channel\_priority strict
pip install tensorflow-gpu==1.15.0
"ONLY THIS MUCH FOR CPU SETUP" (GPU version also installs CPU)
conda install cudatoolkit=10 -c conda-forge
conda config --set channel\_priority flexible
conda install cudnn=7.3.1
"AND NOW THE GPU SETUP IS ALSO DONE"
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-07-06
|
There will be 4 different workbenches, each with different runs and data. The goal is to train the model with the runs of each of the 4 workbenches until it knows how to identify the workbench if given a set of data.
I have been searching on similar topics but couldn't find any. Is there any video or documentation that explains how to do it?
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-04-06
|
It is a classification task as you want to classify the data. It is possible using deep learning. However, you should first check the data at hand to see if classes are easily distinguishable. You might find that it might be easier than expected, which could mean that using a deep model is overkill. It depends on the amount/type of data. [I just searched in google a notebook with a few examples.](https://www.kaggle.com/code/rakesh6184/seaborn-plot-to-visualize-iris-data)
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
My code runs fine on my machine, doing signal filtering and inference in about 2 minutes. The same code takes about 8 minutes on GCP. Everything is slower, including e.g. calls to scipy.signal functions. The delay seems to be in PyCapsule.TFE\_Py\_Execute. Tensorflow 2.15.1 on both machines, numpy, scipy, scikit-learn, nvidia\* are the same versions. The only difference I see that might be relevant is the version of python on GCP is from conda-forge.
Any insights greatly appreciated!
My machine (i9-13900k, RTX A4500):
```
└─ 82.053 RawClassifier.classify ../../src/module/classifier.py:209
├─ 71.303 Model.predictions ../../src/module/model.py:135
│ ├─ 43.145 Model.process ../../src/module/model.py:78
│ │ ├─ 24.823 load_model keras/src/saving/saving_api.py:176
│ │ │ [5 frames hidden] keras
│ │ └─ 17.803 error_handler keras/src/utils/traceback_utils.py:59
│ │ [22 frames hidden] keras, tensorflow, <built-in>
│ ├─ 15.379 Model.process ../../src/module/model.py:78
│ │ ├─ 6.440 load_model keras/src/saving/saving_api.py:176
│ │ │ [5 frames hidden] keras
│ │ └─ 8.411 error_handler keras/src/utils/traceback_utils.py:59
│ │ [12 frames hidden] keras, tensorflow, <built-in>
│ └─ 12.772 Model.process ../../src/module/model.py:78
│ ├─ 6.632 load_model keras/src/saving/saving_api.py:176
│ │ [6 frames hidden] keras
│ └─ 5.580 error_handler keras/src/utils/traceback_utils.py:59
```
Compared to GCP (8 vCPU, T4):
```
└─ 262.203 RawClassifier.classify ../../module/classifier.py:212
├─ 226.644 Model.predictions ../../module/model.py:129
│ ├─ 150.693 Model.process ../../module/model.py:72
│ │ ├─ 25.310 load_model keras/src/saving/saving_api.py:176
│ │ │ [6 frames hidden] keras
│ │ └─ 123.869 error_handler keras/src/utils/traceback_utils.py:59
│ │ [22 frames hidden] keras, tensorflow, <built-in>
│ ├─ 42.631 Model.process ../../module/model.py:72
│ │ ├─ 6.830 load_model keras/src/saving/saving_api.py:176
│ │ │ [2 frames hidden] keras
│ │ └─ 34.270 error_handler keras/src/utils/traceback_utils.py:59
│ │ [16 frames hidden] keras, tensorflow, <built-in>
│ └─ 33.308 Model.process ../../module/model.py:72
│ ├─ 7.387 load_model keras/src/saving/saving_api.py:176
│ │ [2 frames hidden] keras
│ └─ 24.427 error_handler keras/src/utils/traceback_utils.py:59
```
And more detail on the GCP run. Note the next to the last line that calls PyCapsule.TFE\_Py\_Execute:
```
├─ 262.203 RawClassifier.classify ../../module/classifier.py:212
│ ├─ 226.644 Model.predictions ../../module/model.py:129
│ │ ├─ 226.633 Model.process ../../module/model.py:72
│ │ │ ├─ 182.566 error_handler keras/src/utils/traceback_utils.py:59
│ │ │ │ ├─ 182.372 Functional.predict keras/src/engine/training.py:2451
│ │ │ │ │ ├─ 170.326 error_handler tensorflow/python/util/traceback_utils.py:138
│ │ │ │ │ │ └─ 170.326 Function.__call__ tensorflow/python/eager/polymorphic_function/polymorphic_function.py:803
│ │ │ │ │ │ └─ 170.326 Function._call tensorflow/python/eager/polymorphic_function/polymorphic_function.py:850
│ │ │ │ │ │ ├─ 141.490 call_function tensorflow/python/eager/polymorphic_function/tracing_compilation.py:125
│ │ │ │ │ │ │ ├─ 137.241 ConcreteFunction._call_flat tensorflow/python/eager/polymorphic_function/concrete_function.py:1209
│ │ │ │ │ │ │ │ ├─ 137.240 AtomicFunction.flat_call tensorflow/python/eager/polymorphic_function/atomic_function.py:215
│ │ │ │ │ │ │ │ │ ├─ 137.239 AtomicFunction.__call__ tensorflow/python/eager/polymorphic_function/atomic_function.py:220
│ │ │ │ │ │ │ │ │ │ ├─ 137.233 Context.call_function tensorflow/python/eager/context.py:1469
│ │ │ │ │ │ │ │ │ │ │ ├─ 137.230 quick_execute tensorflow/python/eager/execute.py:28
│ │ │ │ │ │ │ │ │ │ │ │ ├─ 137.190 PyCapsule.TFE_Py_Execute <built-in>
│ │ │ │ │ │ │ │ │ │ │ │ └─ 0.040 <listcomp> tensorflow/python/eager/execute.py:54
```
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-05-06
|
I was saving my Keras model using the following code:
inputs = keras.Input(shape=(1,), dtype="string")
processed_inputs = text_vectorization(inputs)
outputs = model(processed_inputs)
inference_model = keras.Model(inputs, outputs)
(I got the code from François Chollet book)
After upgrading Tensorflow, I am unable to load the model and make predictions on a DataFrame. My current code for loading the model and predicting is as follows:
loaded_model = load_model('model.keras')
load_LE = joblib.load('label_encoder.joblib')
input_string = "i just usit for nothin"
xd = pd.DataFrame({'Comentario': [input_string]})
preddict = loaded_model.predict(xd['Comentario'])
predicted_clasess = preddict.argmax(axis=1)
xd['Prediccion'] = load_LE.inverse_transform(predicted_clasess)
However, I am encountering the following error:
object of type 'bool' has no len()
List of objects that could not be loaded:
[<TextVectorization name=text\\\_vectorization, built=True>, <StringLookup name=string\\\_lookup\\\_2, built=False>]
Details:
* The error occurs when attempting to load the model and predict on a DataFrame.
* The model includes a TextVectorization layer and a StringLookup layer.
* I tried to reinstall the earlier version but the problem its the same
Any advice or insights would be greatly appreciated!
UPDATE:
On the same notebook that i trained the model i can make predictions:
raw_text_data = tf.convert_to_tensor([
["That was an excellent movie, I loved it."],
])
predictions = inference_model(raw_text_data)
predictions
But if i try to load the model on another notebook i get:
`[<TextVectorization name=text\\\_vectorization, built=True>, <StringLookup name=string\\\_lookup\\\_9, built=False>]`
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-05-06
|
Im getting tons of `pxtas warning : Registers are spilled to local memory in function` messages as my model compiles. I am not entirely sure what this means, I assume it has something to do with running out of memory in the gpu ?
Searching through the docs, I saw some of the tutorial code output also had this warning in it, but it is not adressed. I couldn't get rid of it, so I assumed it isnt a big deal since it was training.
I just want to make sure this is not something to worry about, especially since I'm a bit surprised with its (seemingly good) performance.
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-05-06
|
I am a developer in the water and wastewater sector. I work on compliance reporting software, where users enter well meter readings and lift station pump dial readings. I want to train a model with TensorFlow to have technicians take a photo of the meter or dial and have TensorFlow retrieve the reading.
Our apps are native (Kotlin for Android and Swift for iOS). Our backend is written in Node.js, but I know Python and could use that for Tensorflow.
My question is, what would be the best way to implement this? Our apps have an offline mode. Some of our techs have older phones, but some have newer phones. Some of the wells and lift stations are in areas with weak service.
I'm concerned about accuracy and processing time on top of these two things. Would using TensorFlow lite result in decreased accuracy?
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-06-06
|
>Would using TensorFlow lite result in decreased accuracy?
Not necessarily. It *can* result in decreased accuracy if you compress the model (which is kind of the point of using TensorFlow Lite), but you don't need to do this if you can get away with not doing it. Of course, you also have control of the optimization process, and you can tune the process to minimize accuracy loss, etc. [Here's a link to their docs with pertinent information](https://www.tensorflow.org/lite/performance/model_optimization).
>My question is, what would be the best way to implement this? Our apps have an offline mode. Some of our techs have older phones, but some have newer phones. Some of the wells and lift stations are in areas with weak service.
Asking if this is the "best' way to implement this is pretty open-ended. It's certainly a good option to evaluate given the context, but there are other options available depending on your overall requirements, constraints, etc. I'd say it'd certainly be preferable to be able to use full TensorFlow since it's more flexible, provides better compatibility, etc. But TensorFlow Lite should definitely be investigated next if you find TensorFlow is too heavy.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-06-06
|
This is one of the first deep learning courses I took, and it was amazing! Hands on no bullshit, you get to build projects immediately. You can easily use your own data on the projects. Good way to start creating your portfolio.
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-07-06
|
I am a begining on deep learning and tbis was my first course as well. Is there another one as good as this that I should do next?
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-07-06
|
Hi is anyone interested in learning ai and topics such as machine learning, deep learning in more depth? I'm a beginner in ai but looking to expand my knowledge in the field and improve in Python also. If you are interested, leave a comment below and i will dm you.
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-07-06
|
Hi!
I’m trying to train the top layers of EffficientNetB0 for object detection and classification in an image set. I’ve COCO annotated and split images to produce 1k+ sub images, and am training based upon these and ImageGenerator tweaks. However, my loss rate will not drop and my accuracy hovers at 35% (33% would be just guessing with three object classes) over 50+ epochs with a 32 batch size. I’m using Adam with a 0.001 learning rate.
What might I do to improve performance?
Thank you!
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-07-06
|
Without more info it's impossible to tell you.
It could be a host of problems. You're going to have to figure out if anything is changing in the weights or not. If they are let it go longer. If not check your code to ensure it's set up properly. If there's still no improvement it may be a data issue or model issue. Those are harder to track down.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-07-06
|
I passed the Tensorflow Developer exam last month. Failed the first time and practised various online tutorials and the problems that stumped me in the exam before passing. Now I'm sending out job applications to become a junior ML Engineer, and moving my best work onto github so I can showcase my abilities. These are pretty basic models, so I want to demonstrate that I'm capable of learning to do production work.
What are the best next steps to take to improve my portfolio for job applications? Should I tackle larger datasets and more complex models, learn how to install and run Tensorflow using docker on AWS, refactor my existing models to show I have a decent grasp of software engineering principles, or something else?
PS I've done natural resource data analysis for several decades. I have a fairly recent PhD in Information Systems and a BSc in Physics from a long time ago. I know it's a long shot to break into the ML industry, but I want to give it my best shot :)
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-08-06
|
I’m not an expert at portfolios, but the next step would be to have an understanding of MLOps. I think coursera has a specialisation on this. You can also check out pytorch. Just a different framework, but is much more popular. A few projects in that would get you familiarised with it. And all the best.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-08-06
|
Will check these out, thanks! I've been looking into pytorch and huggingface a bit
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-08-06
|
I have a problem with tensorflow Datasets, in particular I load some big numpy arrays in a python dictionary in the following way:
for t in ['train', 'val', 'test']:
try:
array_dict[f'x_{t}'] = np.load(f'{self.folder}/x_{t}.npy',mmap_mode='c')
array_dict[f'y_{t}'] = np.load(f'{self.folder}/y_{t}.npy',mmap_mode='c')
except Exception as e:
logger.error(f'Error loading {t} data: {e}')
raise e
then in another part of the code I convert them in Datasets like so:
train_ds = tf.data.Dataset.from_tensor_slices((array_dict['x_train'], array_dict['y_train'], array_dict['weights'])).shuffle(1000).batch(BATCH_SIZE)
val_ds = tf.data.Dataset.from_tensor_slices((array_dict['x_val'], array_dict['y_val'])).batch(BATCH_SIZE)
and then feed these to a keras\_tuner tuner to optimize my model hyperparameters. This brings to a segfault just after the training of the first tentative model starts. The same happens with a normal keras.Sequential model, so the problem is not keras\_tuner. I noticed that if I reduce the size of the arrays (taking for example only 1000 samples) it works for a bit, but still gives segfault. The training works fine with numpy arrays, but I cannot use all the resources needed to keep the full arrays in memory, so I was trying datasets to reduce the memory usage. Any advice on how to solve this or a better way to manage the memory usage? Thanks
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-10-06
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-10-06
|
|
How to do somekind of workaround this problem, so i can train it on my machine?
I am doing it in VSC in WSL because script is also using CuDF
I am running out of VRAM i think, as i am getting "Killed" prompt in console, i have 32 GB of ram and 12GB of VRAM
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-10-06
|
I’m currently a sophomore in college, dual major applied mathematics and computer science (not too relevant, I just need to drop the fact I’m a double major as much as I can to make the work worth it).
I tried learning the mathematical background, but fell off around back propagation.
Recently I’ve been learning how to use tensorflow, as well as the visualization and uses of different models (CNN, LSTM, GRU, normal NN is about it so far).
I’ve made my first CNN model, but I can’t seem to get it past 87% accuracy, and I tried to use a confusion matrix but it isn’t yielding anything great as it feels like guess and check with an extra step.
Does anyone have a recommendation on what to learn for creating better model architecture, as well as how I can evaluate the output of my model to see what needs to be changed within the architecture to yield better results?
(Side note)
Super glad this community exists! It’s awesome to able to talk to everyone from all different stages in the AI game.
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-11-06
|
You *cannot* get pass 87% accuracy could because:
- the date set is poor, like the images is blurry
- the optimizer parameters are wrong, like the learning rate is too big
- your model is too small, so it simply cannot learn that task
There are lots of CNN based models. You could try some other variations.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-11-06
|
Thank you for the reply I appreciate it; have an image of my model attached , [Simple Cat/Dog CNN with Kaggle](https://imgur.com/a/IEEcgVi), but I’m using a .001 learning rate and have about 12,499 pictures of cats and dogs (total of about 25000) off the Kaggle pet images dataset. I always hear about this being the first model people tend to make, so 87% accuracy for some beginner knowledge is solid, I was just wondering if I was missing any methods I could use. I’ll look into some CNN variations, thanks again!
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-11-06
|
Drop rate is 0.5? Try smaller values.
Batch size is 32. If that is the limit of your hardware, try a smaller learning rate.
30 training epochs is probably too low. Did you see the loss value plateau already? If not, could use more training epochs.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-11-06
|
The loss value does start to plateau after the 30 epochs, and I tried pushing it further and the model ends up with a lot of incorrect predictions, so I think that means there is some overfitting past 30.
I will say, my computer isn’t horrible but for some reason a model takes like ten minutes to run, so I’ve been looking for like cloud computing services with free trials just to try and speed up my models.
To be honest looking back I actually haven’t tried adjusting the learning rate (I don’t know how that slipped my mind) but I’ll cook with your recommendations and see how it all turns out!
Thanks a lot for the help I really appreciate it, I’ll be sure to update you 🙏.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-11-06
|
If you are overfitting after 30 Epochs with a dataset that large and augmentation on something else is wrong.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-11-06
|
I’ll double check my code, I did write a function to automatically assign labels to images via the path to the folder as well as split up the test and validation data, so that could by why
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-11-06
|
Bigger network, lower learning rate or higher learning rate with gradient clipping, lower dropout rate (also make sure to disable dropout when evaluating), use batchnorm, play with the regularization rate, etc.
Don't expect your model to be as good as a kaggler's, after a certain point optimization is kind of like cooking and you need to develop an intuition on what's going wrong with it, and stare at a lot of plots and baby the model to see what's going on.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-11-06
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-12-06
|
|
To all: mark as spam please.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-18-06
|
I'm running this note book on my set of images and would like to save this model to my machine.
[https://www.tensorflow.org/tutorials/generative/cyclegan](https://www.tensorflow.org/tutorials/generative/cyclegan)
How do I save the generators and discriminators locally.
This is the error I get when I save it as a .keras file.
Exception encountered: Could not deserialize class 'InstanceNormalization' because its parent module tensorflow\_examples.models.pix2pix.pix2pix cannot be imported. Full object config: {'module': 'tensorflow\_examples.models.pix2pix.pix2pix', 'class\_name': 'InstanceNormalization', 'config': {'trainable': True, 'dtype': 'float32'}, 'registered\_name': 'InstanceNormalization', 'build\_config': {'input\_shape': \[None, None, None, 128\]}}Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?36f4b647-4e03-4652-bdcd-c9af79293a08) or open in a [text editor](command:workbench.action.openLargeOutput?36f4b647-4e03-4652-bdcd-c9af79293a08). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-12-06
|
I am trying to make object detection work using tensorflow on a GPU.
and its just so damn hard, the same happened when I was trying to use GPU for ultralytics yolov8 and I ended up abandoning the damn project coz it was so much work and still GPU wasn't being identified
now,
in my conda environment
`nvcc --version`
returns
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Feb__8_05:53:42_Coordinated_Universal_Time_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0
and nvidia-smi also returns the right stuff showing my GPU
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.99 Driver Version: 555.99 CUDA Version: 12.5 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4060 ... WDDM | 00000000:01:00.0 Off | N/A |
| N/A 51C P3 12W / 74W | 0MiB / 8188MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
and I've installed latest tensorflow version, my drivers are updated, I've installed cuDNN etc.
but still tensorflow would just not use my GPU.
when I run
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
it returns
2024-06-12 18:20:08.721352: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
WARNING:tensorflow:From C:\Users\PrakrishtPrakrisht\anaconda3\envs\tf2\Lib\site-packages\keras\src\losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.
Num GPUs Available: 0
Someone help me with this!! 🤦♂️
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-12-06
|
Are you using Windows?
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
yessir
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
That's why you're having issues.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
so, what's the solution?
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
Which tensorflow version are you using?
I am mostly on Mac/linux but with the WSL setup on newer tensorflow versions many of these problems were solved.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
Use Linux. Much easier, too.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
You need to downgrade the Nvidia driver version afaik. And tensorflow has stopped supporting window with GPU. Sooo, either use wsl, which is Ubuntu.. or directly use Ubuntu
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
but, I've "heard" about nvidia and linux not working together very well
ps: I haven't coded for last 1-1.5 years, so I'm outta touch
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
Just use a docker Container
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
I think that's more true for gaming
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-12-06
|
I assume you are using the latest tensorflow version?
Please read https://www.tensorflow.org/install/pip carefully.
Please move on and use Linux or wsl.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-13-06
|
https://engineering.purdue.edu/ECN/Support/KB/Docs/setup-tensorflow-in-windows-server-with-gpu , follow this, works wonder for me on windows 11 pro , but need to use conda
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-13-06
|
Have you tried making a conda venv then making it run on the gpu, I saw a video about it online.
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-13-06
|
Use wsl2 (Windows subsystem for Linux). Pretty easy to set up and gives you a real Linux install living *inside* your windows install.
Once installed you can just run 'wsl' and get a Linux prompt. Worth it just to get filenames that use slashes rather than backslashes but makes development easier in general.
https://learn.microsoft.com/en-us/windows/wsl/install
|
r/tensorflow
|
comment
|
r/tensorflow
|
2024-13-06
|
Hi everyone,
I’d love understand the challenges people face when serving custom or fine-tuned open-source models for internal testing or beta rollouts.
Here are some common issues I’ve observed:
1. **Difficulty Hosting Models via Endpoints**: Teams often end up sharing model outputs manually, preventing effective testing by teammates.
2. **Non-Serverless Deployments**: Forgetting to stop instances leads to unexpected high bills from cloud providers.
3. **Custom Libraries with Maintenance Overhead**: Some teams have built custom solutions that solve these issues, but they introduce maintenance overhead and slow down development.
I’d love to hear from anyone who has experienced these or other challenges when serving custom models. Your insights would be invaluable.
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-12-06
|
Hi,
I’m having trouble utilizing my GPU with TensorFlow. I’ve ensured that the dependencies between CUDA, cuDNN, and the NVIDIA driver are compatible, but it’s still not working. Here are the details of my setup:
• TensorFlow: 2.16.1
• CUDA Toolkit: 12.3
• cuDNN: 8.9.6.50_cuda12-X
• NVIDIA Driver: 551.61
GPU RTX 4090
Can anyone suggest how to resolve this issue?
Thanks!
|
r/tensorflow
|
post
|
r/tensorflow
|
2024-12-06
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.