id
stringlengths 3
8
| text
stringlengths 1
115k
|
---|---|
st206300 | I was tracing back the objectdetection object in the repository of the API. Maybe it was luck, but I found out how to get the object detection layers at least the Prediction head:
detection_model._box_predictor._prediction_heads[‘class_predictions_with_background’]._class_predictor_layers[0]
Hopefully helps |
st206301 | my bad my last approach get the layer but no as tensor, I mean the layer doesnt response to layer.outputs[0] because is not a keras tensor to get the feature map. Well I’m still as the last time |
st206302 | Considering the feature maps in an SSD model:
Medium – 15 Dec 20
SSD object detection: Single Shot MultiBox Detector for real-time processing 44
SSD is designed for object detection in real-time. Faster R-CNN uses a region proposal network to create boundary boxes and utilizes those…
Reading time: 11 min read
What specific feature map do you want take here? |
st206303 | The prediction class layers, but I need at least the last prediction layer as a tensor. I found the prediction_head; this one lacks the output feature. Hence is not compatible to use to get the feature map of the model in that layer. |
st206304 | Once you are able to load the detection checkpoints into their respective model class I think it should be possible to access the layers just by their indices.
OD API models may often seem to be a bit opaque. I would also suggest taking a look at the Model Garden object detection models since they seem to be more transparent and accessible with regards to the interpretability aspects:
github.com
tensorflow/models 44
master/official/vision/detection
Models and examples built with TensorFlow. Contribute to tensorflow/models development by creating an account on GitHub. |
st206305 | Thanks, I use to think the same that once a checkpoint is loaded was possible to access the layers by their indices or similar. But was not the case with the object detection API. I will take a look at your proposal nevertheless is frustrating the current state and documentation of the API. |
st206306 | Hi! I have worked building NLP models with tensorflow with/wout keras for some time. I faced an issue with keras and tensorflow while trying to do the following:
input = tf.keras.layers.Input(shape=(MAX_WORDS, MAX_CHARS))
char_embedded = tf.keras.layers.Embedding(...)(input)
So now char embedding has dimension (dynamic batch size, MAX_WORDS, MAX_CHARS, embedding_dim), and doing any of the following throws an error:
tf.keras.layers.LSTM(...)(char_embedded)
tf.keras.layers.Conv1D(...)(char_embedded)
This error is caused because the tensor is 4 dimensional and both Conv1D or RNNs expect a 3 dimensional tensor. This is used in NER tagging or NLP for unknown words when we then concatenate the resulting char digest per word as a part of the word embeddings.
I have a wordaround for this:
lstm = tf.keras.layers.LSTM(...)
digests = []
for text in tf.unstack(char_embedded):
digests.append(lstm(text))
digests = tf.stack(digests)
So now i have in digests what i wanted with dimension (FIXED_BATCH_SIZE, MAX_WORDS, output_dim).
In order for unstack to work it needs to know the batch size while building the graph, so im forced to make it constant:
input = tf.keras.layers.Input(shape=(MAX_WORDS, MAX_CHARS), batch_size=FIXED_BATCH_SIZE)
This whole solution has several disadvantages:
It’s messy in code
The TF graph looks awful in tensorboard and is slower to build so i guess it’s also a mess there
Forces me to train and predict with batch_size divisible amount of data, which is annoying because i have to constantly padding and unpadding things
If i have to predict for 1 item i have to pay the time cost of predicting for FIXED_BATCH_SIZE padding it
The last item has a final workaround that is training with the fixed batch size graph and then with those layers create the graph fixed with a batch size of 1, but this adds complexity to the code.
I have been using this workaround for 2 years now, and it works, and had no problems with it others than the listed ones, buut, i always thought it has to be a better way and probably much much strightforward and simple. So, is there?
Thanks,
Gianmarco. |
st206307 | Hi there,
TensorFlow 2.5.0 is based on cuDNN 8.x, which no longer has the 2 billion elements per tensor limitation of cuDNN 7.x:
https://docs.nvidia.com/deeplearning/cudnn/release-notes/rel_8.html 9
I would like to know: does TensorFlow have a limitation of its own, independently of cuDNN, limiting the number of elements in a tensor?
Thank you,
OD |
st206308 | Subclassing tf.keras.Model and overrding its train_step() function give us the kind of flexibility we need to control our training loops. It allows for easily plugging in our favorite callbacks, and almost do all kinds of stuff that are readily available during model.fit().
I am wondering how to use the ModelCheckpoint callback in this instance. Consider the following use-case (taken from here 2):
class SimSiam(tf.keras.Model):
def __init__(self, encoder, predictor):
super(SimSiam, self).__init__()
self.encoder = encoder
self.predictor = predictor
self.loss_tracker = tf.keras.metrics.Mean(name="loss")
How do I set up a ModelCheckpoint callback for this one? |
st206309 | Of course. But that somehow defeats the purpose of progressive disclosure of complexity IMO. I wanted to able to focus on my training loop and delegate rest of the things to the framework whenever possible.
And the link does not elaboratively suggest a workaround for the use-case I mentioned. |
st206310 | This is more that what you are looking for as It Is relative also to write a custom callback in a custom train loop:
Medium – 7 Apr 21
Custom Training with Custom Callbacks 2
Using callbacks in a custom training and evaluation loop in Keras. A Hands-On tutorial.
Reading time: 5 min read
But also in your case if you manually populate the CallbackList
TensorFlow
tf.keras.callbacks.CallbackList | TensorFlow Core v2.5.0 3
Container abstracting a list of callbacks.
I think that you still need to trigger the epoch event in your custom training loop. |
st206311 | Bhack:
I think that you still need to trigger the epoch event in your custom training loop.
I guess for that I might need to discard the train_step() override which I don’t want to do. I will study the links you shared and get back. |
st206312 | Sayak_Paul:
How do I set up a ModelCheckpoint callback for this one?
Could you clarify the question? Why doesn’t it work to just pass the callback to .fit like you normally would?
Bhack:
But also in your case if you manually populate the CallbackList
Yes. If you’re writing your own training loop, you need to drive the callbacks section using callback list here:
TensorFlow
tf.keras.callbacks.Callback | TensorFlow Core v2.5.0 3
Abstract base class used to build new callbacks.
But if you’er using .train_step and .fit, all the callbacks should be driven as normal, no? |
st206313 | Callback list seems to be a good option. I will try it out.
markdaoust:
But if you’er using .train_step and .fit, all the callbacks should be driven as normal, no?
If your subclassed model (where I am overriding train_step()) contains two or more models and if you are passing ModelCheckpoint callback while calling .fit() on the subclassed model the callback would get confused. |
st206314 | Sayak_Paul:
If your subclassed model (where I am overriding train_step()) contains two or more models and if you are passing ModelCheckpoint callback while calling .fit() on the subclassed model the callback would get confused.
That shouldn’t be like that. Models are supposed to be nestable.
…
The problem here is that the callback is defaulting to saving the model in HDF5 format (which apparently requires that to call .fit to set the input shape, and we don’t call fit on the nested mopdels.).
Set save_weights_only=True to save in the tensorflow checkpoint format and then it works. |
st206315 | Okay. Let me test-drive this on the following since it has two networks present in the subclassed model SimSiam:
keras.io
Keras documentation: Self-supervised contrastive learning with SimSiam 3
But I think it should be ambiguous for the callback to determine which network (out of the two) it should serialize, though. |
st206316 | My hunch was totally wrong it seems. It seems to work right off the bat with save_weights_only=True:
colab.research.google.com
Google Colaboratory 2 |
st206317 | But I think it should be ambiguous for the callback to determine which network (out of the two) it should serialize, though.
It saves a checkpoint of the whole SimSiam Model, that captures both of the nested models. |
st206318 | I’m working on running ML models from TF on microcontrollers. For scaling the data: Is there a way getting the calculated values for ‘mean’ and ‘std’ from the StandardScaler? Or is there an easy way of scaling my sensor data using the same scaling in Arduino code on the device?
Thank you for your advice. |
st206319 | I’ve found a solution, if anyone wants to know:
In tensorflow scale the data normally:
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
scaler.fit(X_train)
X_train = scaler.transform(X_train)
X_test = scaler.transform(X_test)
To get the mean type: scaler.mean_
To get the std type: scaler.scale_
Copy and paste these figures into your Arduino code using the formula below:
The standard score of a sample x is calculated as:
z = (x - u) / s
where u is the mean of the training samples or zero if with_mean=False, and s is the standard deviation of the training samples or one if with_std=False.
Example code below:
float Sensor1 = (sensorReading1 - mean_) / scale_; |
st206320 | Hello everyone, I recently working on some TFLite and TFLite quantization work and encountered some questions. I did raised those questions on
github.com
tensorflow/tensorflow 4
s
An Open Source Machine Learning Framework for Everyone
I am thinking to find some more efficient ways to communicate with Engineers like open discussion via ZOOM or some 1-on-1 session.
Is there anything like what I described? |
st206321 | @Orange_J , I am not sure about 1-to-1 talks but this (tf forum) is I think the right place to ask your questions. You can tag the person who you think can answer your question |
st206322 | At what granularity should I apply tf.function to my models and layers? Should I decorate every layer’s call with @tf.function or just the model layer’s call method, or just the training step?
It seems to me that decorating keras layers’ call method is not really intended, as tf.function does not support keyword-arguments like training or mask. |
st206323 | Using tf.function gives you performance as well as reusability benefits by using same traces and gives you flexibility to use concrete functions.
Attaching doc reference 7 for how better performance can be achieved with tf.function. |
st206324 | In image classification, it is obvious that images are considered as samples but what is considered as samples in Tensorflow object detection API? Are the samples images or the individual objects in the images?
if an image contains 10 objects, should I consider 10 objects as training samples or just a single image?
I need to know this to effectively set batch size and steps for training. |
st206325 | The question is very interesting.
IMO it should be images here as well since what we define in API config as batch_size is number of images while training object detection model. |
st206326 | The default input size that resnet50 takes is 224*224,so now can i change the input size of the architecture to some higher resolution and still work on it in tensorfow? |
st206327 | Looking at the Keras Documentation 24, it seems that it is possible but you will have to not include the fully-connected layer/dense layers at the top of the network. |
st206328 | Chaitu28:
The default input size that resnet50 takes is 224*224
Hi @Chaitu28 On the ResNet-50 TF Hub page 3 it says:
m = tf.keras.Sequential([
hub.KerasLayer("https://tfhub.dev/tensorflow/resnet_50/classification/1")])
m.build([None, 224, 224, 3]) # Batch input shape.
… For this model, the size of the input images is fixed to height x width = 224 x 224 pixels.
So, is your question about how to customize the input shape for the SavedModel of ResNet-50 on TF Hub by any chance? |
st206329 | @Chaitu28 , yes it is possible.
As @8bitmp3 mentioned that you have to use 224 * 224 images to directly feed the model in tfhub.
But you can use existing model for other sized images as well.
How? Let me tell you couple of ways which I can think of:
(1) Very simple solution is to resize your images (specifically I would suggest you to add padding to make square shaped and then reduce the size or center crop) to 224 * 224 and now you can feed to tfhub Resnet-50 model.
(2) More robust approach in this case would be to go for pretraining or transfer learning of a layer. Since you can see that hub.KerasLayer defines the complete Resnet-50 as a layer and this layer is part of sequential model. So, you can define custom input size with one more Conv layer which outputs 224 * 224 * 3 image and that will solve your problem. But note here that with this new model, you need to train the model over your data which will only train the first Conv layer that we added because hub.KerasLayer by default non-trainable (trainable param is set to False). See below snippet.
m = tf.keras.Sequential([
tf.keras.Input(shape=(custom_height, custom_width, 3)),
tf.keras.layers.Conv2D(....), # Define conv such that it outputs 224 * 224 * 3 images
hub.KerasLayer("https://tfhub.dev/tensorflow/resnet_50/classification/1")])
Also attaching link to doc 5 which can help you |
st206330 | Hi guys!
I need your valuable help to understand better LSTM’s for what I think is a relatively simple sequence , the code below runs however I am not getting the expected results, I am suspecting the way to shape the data, or the sequence definition, could you please shed light ?
import tensorflow as tf
from tensorflow.keras.layers import Embedding, LSTM, Dense, Bidirectional
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam
import numpy as np
import matplotlib.pyplot as plt
#function to plot training
def plot_graphs(history, string):
plt.plot(history.history[string])
plt.xlabel("Epochs")
plt.ylabel(string)
plt.show()
#the data
# eleven samples, each sample has been divided in 5 sub-sequences of 3 elements each
# e.g. 1,2,3 is one part of the first line / sequence, 10,11,12 is the next
# Expected behaviour:
# input 50,51 output 52
# input 61,62 output 70
# input 2002,2003 output 2010
data = np.array([
1,2,3,10,11,12,20,21,22,30,31,32,40,41,42
,101,102,103,110,111,112,120,121,122,130,131,132,140,141,142
,201,202,203,210,211,212,220,221,222,230,231,232,240,241,242
,301,302,303,310,311,312,320,321,322,330,331,332,340,341,342
,401,402,403,410,411,412,420,421,422,430,431,432,440,441,442
,501,502,503,510,511,512,520,521,522,530,531,532,540,541,542
,601,602,603,610,611,612,620,621,622,630,631,632,640,641,642
,701,702,703,710,711,712,720,721,722,730,731,732,740,741,742
,801,802,803,810,811,812,820,821,822,830,831,832,840,841,842
,901,902,903,910,911,912,920,921,922,930,931,932,940,941,942
,1001,1002,1003,1010,1011,1012,1020,1021,1022,1030,1031,1032,1040,1041,1042
])
#I am not sure if this is the right way to shape the data
data = data.reshape(11,5,3)
#print(data)
#slice the data , so the 3rd element of each subsequence of 3 elements is the label and the first 2 are the input
#e.g. 1,2,3 1,2 is the input, 3 is the label
xs = data[:,:,:-1]
ys = data[:,:,-1:]
#print ('xs')
#print (xs)
#print ('ys')
#print (ys)
#define the model
lossf = tf.keras.losses.MeanAbsoluteError()
model = Sequential()
#tried this but didn't make a difference for good
#model.add(tf.keras.layers.BatchNormalization(input_shape=( 5, 2) ))
#model.add(Bidirectional(LSTM(150, activation='relu')))
model.add(Bidirectional(LSTM(50, activation='relu' ), input_shape=( 5, 2)))
model.add(Dense(1))
adam = Adam(learning_rate=0.0001, )
model.compile(loss=lossf, optimizer=adam, metrics=['accuracy'])
#fit
history = model.fit(xs, ys, epochs=120,
verbose=1 ,
validation_split=0.1 ,
batch_size=5
#, shuffle=True
)
#plot
plot_graphs(history, 'accuracy')
plot_graphs(history, 'loss')
plot_graphs(history, 'val_accuracy')
plot_graphs(history, 'val_loss')
#try it
predicted = model.predict( [[[50, 51]]], verbose=0) # expected 52
print ('Predicted value ' , predicted )
predicted = model.predict( [[[61, 62]]], verbose=0) # expected 70
print ('Predicted value ' , predicted )
predicted = model.predict( [[[2002, 2003]]], verbose=0) # expected 2010
print ('Predicted value ' , predicted ) |
st206331 | For series data like that, you could try to convert the series into windows. Feeding the whole series to the neural net is possible but won’t give accurate results.
Take a look at this 16. |
st206332 | So @GeorgeMR look at it this way.
The way you are creating your sequence training data is incorrect for your expected output.
data.reshape(11,5,3)
What this does is equivalent to creating 11 batches with 5 sequences in each batch, each sequence of length 3. If you look at the individual sequence in your training data, you always have a sequence like the ones below:
[1,2,3]
[20,21,22]
[401,402,403] and so on.
You never encounter a sequence in your training data like the ones below:
[21,22,30]
[1022,1030,1031] and so on.
This is happening because you are splitting your sequence of (length 15) into 5 subsequences of (length 3) which does not represent the whole original (length 15) sequence. The smaller (length 3) is missing out to include the seasonality in the longer sequence.
You need to use the sliding window approach as mentioned by @Jean (Time series forecasting | TensorFlow Core 11) to preprocess your sequence and generate the training data. Hope this helps! |
st206333 | Thanks @Jean and @aditya1601 , I will try the windows technique, regarding aditya’s comment, the model doesn’t even learn to Add 1 to every number as it is supplied via the current split, I get that the rest of the sequence is ‘disconnected’ but the commonality of every 3-consecutive-numbers sets is not being picked up by the model, instead it it give something like 51, 52 … prediction = 4.23 |
st206334 | Hi @GeorgeMR. There are many factors due to which the model may not be learning. For starters, the window size is too short. Try experimenting with a window size of at least 5. Try to use a simpler model and overfit it. Try to play with different optimizers and learning rates. All these hyperparameter tuning will definitely help in finding out the solution. Please share with us what worked at the end! |
st206335 | Time series are hard to process compared to other datasets. When converting the series into windows, you can keep the windows of the same sizes. If you are using tf.data.Dataset, you will set the drop_remainder=True to drop all windows not having the size you provided.
In addition to @aditya1601 ideas on improving the model, you can try to schedule the learning rate.
I had the same experiment, tweaked different hyperparameters, but what accounted for the increments in the metric (Mean absolute error) was using the Learning Rate Scheduler and keeping the model simple. It might not be the same there, but this is what I was able to capture.
If you find it hard to write a series processing function with tf.data.Dataset, you can refer to this 5 or this 8 (CC:@Laurence_Moroney). |
st206336 | Hello, I am trying to implement a “custom” convolution routine to perform spherical convolutions.
Basically, I store my spherical image as a 1D array following the healpix pixelisation scheme. I am trying to optimize an already existing routine and I would like to re-implement the convolution step to possibly make it more efficient.
A bit of context, you can skip to the last paragraph for the actual question.
For each element of the input array, I have a function which lets me compute the index of the neighboring pixels. The idea is to perform a convolution on the neighboring pixels of each element of the array. This idea works pretty well, but I fear that the implementation is not optimal.
At the moment, for each pixel I am gathering the neighboring pixels and parsing them in a new 1D array (using the tf.gather) , which results to be a 1D array 9 times bigger on which we perform the convolutions (since each pixel has ~8 neighboring pixels). Once I have such an “ordered array” I can perform simple 1D convolutions with stride=9 to achieve a spherical convolution. For more information about this idea, please take a look at the original paper: http://arxiv.org/abs/1902.04083
The actual question:
What I would like to do now is to tell tensorflow to perform a “custom” convolution, given the index of the elements that I want to convolve. Basically I would like to give tensorflow a series of indexes (one set of indexes for each element of the 1D array) and tell it to convolve them directly. This would involve accessing elements from the 1D array not contiguously, I think.
For example, for element 0 of the array, the convolution would involve the elements [ 0, 4, 11, 3, 2, 1, 6, 5, 13], for pixel 1 [1, 6, 5, 0, 3, 2, 8, 7, 16], for pixel 2 [ 2, 8, 7, 1, 0, 3, 10, 9, 19] and so on.
Is there a way to achieve it? Thank you very much for your help! |
st206337 | Do you think there is interest in developing such things in tensorflow? Apparently, most of the research on spherical convolutions is done using PyTorch, it just seems crazy to me that the same things can’t be achieved in Tensorflow. |
st206338 | Hello everyone!
I am trying to load a deep q model and retrain it with different parameters (e.g. changed epsilon value). I am using a config file for setting various parameters of the environment and the agent.
What is the best way to go about this? Should i use Checkpointer, PolicySaver or something else entirely?
I would be very grateful for your help!
Thank you! |
st206339 | Sarah_Riedmann:
I am trying to load a deep q model and retrain it with different parameters (e.g. changed epsilon value).
I’d have to experiment with this too. Since Checkpointer allows you to save and load not just the policy network state, but also the training state, I’d give that a go. In addition, it seems like it also caches into a replay buffer, which would be useful for sampling in DQN’s case. (tf_agents.utils.common.Checkpointer | TensorFlow Agents 4)
Hope this helps a little. cc @yablak @markdaoust |
st206340 | @Sarah_Riedmann, spoke with tensorflow-agents team member and they advised PolicySaver - it’s TF-Agents specific for saving a policy (with the step, and other info etc). PolicySaver uses Checkpointer underneath. Hope this helps!
TensorFlow
tf_agents.policies.PolicySaver | TensorFlow Agents 2
A PolicySaver allows you to save a tf_policy.Policy to SavedModel. |
st206341 | I have tried using PolicySaver and it works so far. However, I would like to set the loaded policy as the DQN agent’s policy. Is it possible to continue using the agent with the saved policy or do i have to use loaded_policy.action() manually?
Any help would be appreciated! Thank you. |
st206342 | Hello, I am trying to create chess pieces image classification program running on my phone. I trained my model using transfer learning technique. Made 6 classes for the six figures and converted my tf model to tflite model. When I use the model with a labelmap in the android project I get an error stating: Caused by: java.lang.IllegalArgumentException: Label number 6 mismatch the shape on axis 1. The whole error log is here: https://pastebin.com/bxdq9x1r.
This is my tflite model: https://www.pastefile.com/vpg57x
This is my label map: https://www.pastefile.com/9rg9v7 |
st206343 | This is my label map: https://www.pastefile.com/ncfyht .
The link was giving error and I pasted it again.
If needed I can show the code for training the model and converting it to tflite as well as the java code for the android app. |
st206344 | I am using this command for the conversion of tf model to tflite model: command = "tflite_convert \ --saved_model_dir={} \ --output_file={} \ --input_shapes=1,300,300,3 \ --input_arrays=normalized_input_image_tensor \ --output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \ --inference_type=FLOAT \ --allow_custom_ops".format(FROZEN_TFLITE_PATH, TFLITE_MODEL, ).
If you look at input_shapes, I think this is the image shape that the model will be used to, so maybe when i make a picture with my phone I get different shape for example 2000x3000px and then the error occurs. Can it be that one? |
st206345 | In the interpreter API you have an utility to resize your input.
Check
TensorFlow
TensorFlow Lite inference 47 |
st206346 | Hello again, so I checked it and the error was coming from the size of the input image. So I changed the size to match the input size of the model or in my case 640x640. But now I am facing two new errors one is: Cannot copy from a TensorFlowLite tensor with shape [1, 10, 4] to a Java object with shape [1, 6], which means that my shape(which consists of 6 chess figures) does not match the java code which expects 10, 4 so I find this line in the class: imgData = ByteBuffer.allocateDirect( 4 * DIM_IMG_SIZE_X * DIM_IMG_SIZE_Y * DIM_PIXEL_SIZE); and I delete the 4 so this error dissapears, but new one appears: java.nio.BufferOverflowException. I apply my interpreter class now, please help me I really am in a pickle: https://pastebin.com/Hti2zeJm. This exception appears at line 189. Thanks in advance. |
st206347 | Hi Ivan,
I do not think your assumption is correct. Check an error that I forced to appear in my AS project. E/EXECUTOR: something went wrong: Cannot copy to a TensorFlowLite tensor (input) with 1769472 bytes from a Java Buffer with 2211840 bytes. So my model expects 1769472 input and gets 2211840. In your case it expects input [1, 6] and gets [1, 10, 4].
Please check your .tflite file with netron.app to get a visualization of your .tflite file. You are always welcome to give us a link of your project to build and help you.
Best |
st206348 | Hello, thank you a lot for the answer! I am adding my github repo link so you can download the project and look at the error yourself. My github link: https://github.com/ivanpetrov95/chesshelper/tree/master.
Now for the error, I simulated such error by replacing my 640 px size to something bigger or lower, but again I am newbie in the tensorflow area so I might be wrong. My model is in the assets as well as the labelmap and everything needed. I checked my tflite file in netron and I saw that way my needed input must be 640x640x3(3 I think is the RGB, but again I am a newbie), but I could not “read” the output.
Thank you again for looking at my problem and answering me! |
st206349 | Hi Ivan,
I will look into your project and I will get back to you when I figure out what is going on with the inputs to the Interpreter. But you have to definetely check the conversion of your model to tflite because I have also seen that netron.app does not show results for the output of the model. Something is going on there!
Best |
st206350 | Hi Ivan,
I built your project and took a look into it. The result is that your model outputs an array of [1][10][4] and you are givving it an output array of [1][6]. So the problem is at your output of the model. I think you have to check again the conversion to tflite (if pure tensorflow code works correctly) and check it with netron.app. I really do not know what the output should be, so if it has to be an array of [1][6] after the correct convertion you will see this at netron.app.
Besides that there are some other coding issues at your project that I managed to overcome…but they are minor and firstly you have to check the conversion.
Happy to help again. Ping me anytime.
Best |
st206351 | Hello, I looked at my model in netron and indeed I sawo 10 nodes at the output I suppose you talk about them when you say 1, 10, 4. Attaching an image:
https://pasteboard.co/K3mBbgg.png
I have followed a tutoril and I am pretty new to this area, so sorry if I do not have good knowledge about that. I will try building another model and look at it and get in touch with you again. THANK you a lot for the help! |
st206352 | Hello again, I have a problem with converting my .pb file to tflite. I am using tensorflow 1.14 now and I am trying to create the tflite file with tflite_converter. The command is: tflite_convert \ --graph_def_file=tmp/frozen.pb \ --output_file=tmp/model.tflite \ --input_format=TENSORFLOW_GRAPHDEF \ --output_format=TFLITE \ --input_arrays=input_tensor \ --output_arrays=output_pred \ --input_shapes=1,224,224,3 \. The error I get is: ValueError: The shape of tensor 'input_tensor' cannot be changed from (?, ?) to [1, 224, 224, 3]. Shapes must be equal rank, but are 2 and 4 |
st206353 | Also this is the frozen graph file I am trying to convert to tflite with the command: https://www.pastefile.com/ahahwt.
Thank you for the help. |
st206354 | Let’s tag @Sayak_Paul and ask him if he has a colab notebook demonstrating the appropriate way of converting TensorFlow 1.14 .pb files to tflite. |
st206355 | Here’s one:
github.com
sayakpaul/Adventures-in-TensorFlow-Lite/blob/master/DeepLabV3/DeepLab_TFLite_COCO.ipynb 24
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "DeepLab_TFLite_COCO.ipynb",
"provenance": [],
"collapsed_sections": [],
"toc_visible": true,
"authorship_tag": "ABX9TyPr6XoNc6WdPO8DCVAjs4B1",
"include_colab_link": true
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
This file has been truncated. show original |
st206356 | @thea is it possible to install plugins for better code renditions? I would suggest installing at least two: regular Python code and Jupyter Notebook code. |
st206357 | I had posted something similar before 3 but couldn’t get around the problem.
I want to how to properly scale the final loss when it’s composed of two or several other individual loss terms as is common in many use-cases like Image Generation. For example, for image generation, a typical loss function is the following:
total_loss = (alpha * perceptual_loss) + (beta * l1_loss)
Note that the non-reduced versions of perceptual_loss and l1_loss do have the same shapes. So, I guess it becomes necessary to reduce them before summing them up. The official guide 2 does provide some guidance but I could not find something concrete around this particular use-case.
Any pointers regarding this would be very helpful. |
st206358 | I faced the same problem some year ago, and we came up with this solution:
From ashpy/executor.py:
@staticmethod
def reduce_loss(call_fn: Callable) -> Callable:
"""
Create a Decorator to reduce Losses. Used to simplify things.
Apply a ``reduce sum`` operation to the loss and divide the result
by the batch size.
Args:
call_fn (:py:obj:`typing.Callable`): The executor call method.
Return:
:py:obj:`typing.Callable`: The decorated function.
"""
# decorator definition
def _reduce(self, *args, **kwargs):
return tf.nn.compute_average_loss(
call_fn(self, *args, **kwargs),
global_batch_size=self._global_batch_size, # pylint: disable=protected-access
)
return _reduce
and we apply this decorator to the losses - in particular, for the L1 loss used during the adversarial training we use it in this way
class GeneratorL1(GANExecutor):
r"""
L1 loss between the generator output and the target.
.. math::
L_G = E ||x - G(z)||_1
Where x is the target and G(z) is generated image.
"""
def __init__(self) -> None:
"""Initialize the Executor."""
super().__init__(L1())
@Executor.reduce_loss
def call(self, context: GANContext, *, fake: tf.Tensor, real: tf.Tensor, **kwargs):
"""
Call the carried loss on `fake` and `real`.
Args:
context (:py:class:`ashpy.contexts.GANContext`): GAN Context.
fake (:py:class:`tf.Tensor`): Fake data (generated).
real (:py:class:`tf.Tensor`): Real data.
Returns:
:py:class:`tf.Tensor`: Output Tensor.
"""
mae = self._fn(fake, real)
return mae
Using this approach we were able to scale the training on multiple GPUs obtaining the same numerical result of doing the same training on a single GPU (with the same batch size = sum of the batch size used in the single GPU).
Hope it helps
PS: you can find some good insight about adversarial training, gans, distributed training and distribution strategy in the ashpy project 1 - feel free to refer to it or use part of the code |
st206359 | It works for me for a single loss quantity. Like when I am only using L1 or any other loss and reducing it using tf.nn.compute_average_loss. But numerical issues start arising when we comprise different loss functions as is common for many image generation tasks.
My broader goal is to also keep the code as readable and as minimal as possible. |
st206360 | We apply the reduce_loss decorator singularly for every function, and from our experiments (but I’m talking about 2 years ago, so something might have changed in the TensorFlow behavior) there are no numerical stability problem.
E.g.
lambda1* l1 + lambda2 + l2 where lambda1,2 are scalars and l1 and l2 are loss functions decorated with the reduce_loss decorator |
st206361 | Yes, that is what I had thought too. But from this guide 2:
If labels is multi-dimensional, then average the per_example_loss across the number of elements in each sample. For example, if the shape of predictions is (batch_size, H, W, n_classes) and labels is (batch_size, H, W) , you will need to update per_example_loss like: per_example_loss /= tf.cast(tf.reduce_prod(tf.shape(labels)[1:]), tf.float32).
In my case, the perceptual loss and the L1 loss both satisfy this criterion. So, this is what I did and things seem to be working fine:
perceptual_loss = ...
perceptual_loss /= tf.cast(tf.reduce_prod(tf.shape(activations)[1:]), tf.float32)
perceptual_loss = tf.nn.compute_average_loss(perceptual_loss, global_batch_size=BATCH_SIZE)
perceptual_loss = alpha * perceptual_loss
reconstruction_loss = tf.keras.losses.mean_absolute_error(color_images, reconstructed_images)
reconstruction_loss /= tf.cast(tf.reduce_prod(tf.shape(color_images)[1:]), tf.float32)
reconstruction_loss = tf.nn.compute_average_loss(reconstruction_loss, global_batch_size=BATCH_SIZE)
reconstruction_loss = beta * reconstruction_loss
total_loss = perceptual_loss * reconstruction_loss |
st206362 | I am a prefinal year undergrad with decent computer vision knowledge. This summer I am planning to apply as a summer intern to various professors. Any suggestions on what I shall present as my research idea? |
st206363 | As you said thay you have descent knowledge on CV, IMO you may want to focus on GAN based models. Although, GAN itself is very vast field but i can suggest you one topic that i myself thought in my final year.
You may have heard of StyleGAN which produces very high res images of persons that doesn’t exist.
You can focus on creating faces between interpolation space of two images. There can be infinite numbers or faces generated by using linear interpolation of two face vectors. You could start with two and then expand it to work with even multiple face vectors in which the interaction of vectors may become little bit complex. |
st206364 | Okay, I’ll keep that in mind. I was thinking of training Siamese like models to identify faces even with their masks on. Biometrics with face masks. How is that? |
st206365 | That is good idea but I am not sure whether any public dataset is available for it. |
st206366 | There Is GeorgiaTech:
sites.google.com
Home 7
What is MaskTheFace?
MaskTheFace is computer vision-based script to mask faces in images. It uses a dlib based face landmarks detector to identify the face tilt and six key features of the face necessary for applying mask. Based on the face tilt,... |
st206367 | I suggest to take a look to:
arXiv.org
Masked Face Recognition Dataset and Application 7
In order to effectively prevent the spread of COVID-19 virus, almost everyone
wears a mask during coronavirus epidemic. This almost makes conventional facial
recognition technology ineffective in many cases, such as community access
control, face... |
st206368 | If you want to explore some more advanced topics in the same subdomain you could take a look at:
arXiv.org
Face Transformer for Recognition 8
Recently there has been a growing interest in Transformer not only in NLP but
also in computer vision. We wonder if transformer can be used in face
recognition and whether it is better than CNNs. Therefore, we investigate the
performance of...
Hopefully during your summer intern you could contribute a TF version in our model garden
github.com
tensorflow/models 11
Models and examples built with TensorFlow. Contribute to tensorflow/models development by creating an account on GitHub.
And a dataset wrapper in:
github.com
tensorflow/datasets 10
TFDS is a collection of datasets ready to use with TensorFlow, Jax, ... |
st206369 | Here’s a deck I put tgoether last year that might be helpful for you to come up with project ideas and work on them in systematic ways:
docs.google.com
YFP - Sayak 12
Sayak Paul | Deep Learning Associate at PyImageSearch DSC WOW December 07, 2020 Hello everyone. I am Sayak. I am a Deep Learning Associate at PyImageSearch where I work on computer vision with deep learning. Your first machine learning project |
st206370 | Yes! This is a great opportunity for contributing to the Model Garden repository which is under active development.
Besides model implementations (which may seem a bit daunting during first times) you can also consider contributing Colab Notebooks as tutorials which are extremely important to make Model Garden as accessible as possible to the community. |
st206371 | Thank you. This is really helpful.
(haha, coincidentally, I stumbled upon PyImageSearch just yesterday) |
st206372 | How can I compare size of tensor flow model and tensor flow lite model ?
Are there any functions for this or a python module available ?
Like tensor flow model is 10MB and after conversion tflite model is 1MB ? |
st206373 | I have not really understood the question. Do you mean if there is a way to calculate the generated size of tflite file from the original TensorFlow model? |
st206374 | No No !
Ah… what I mean is a simple thing.
What is the size of tensor flow model ?
and What is the size of tflite model ? |
st206375 | Hello!
I am trying to convert a TF2 saved model into a frozen graph so that I can load it into TensorBoard in order to figure out what the input/output node names are. Everything that has to do with conversions to frozen graphs seems to be deprecated. And when I try to load the SavedModel file into tensorboard it is overly complicated and doesn’t show input/output node names. Would anyone be able to help with this please?
Thank,
Ahmad |
st206376 | I guess this is not possible anymore. The SavedModel serialization format is the only format nowadays supported.
You can use the saved_model_cli tool to inspect the content of the saved model and understand what graphs are stored inside and what are the inputs and outputs.
The typical usage of saved_model_cli is as follows
saved_model_cli show --all --dir saved_model_folder
This should show you the content of the saved model. |
st206377 | Thank you sir! This was really helpful.
Do you have any knowledge of loading SavedModels into Tensorboard? I am able to do so but it results in very complicated graphs that aren’t very useful to what I need them for. |
st206378 | I guess you can load the SavedModel as a Keras model
model = tf.keras.models.load_model(saved_model_path)
and once you have it, you can follow the answer I wrote on StackOverflow about how to graph any graph (the call method of a Keras model is always decorated with tf.function hence the same answer applies).
Here’s the answer on SO: https://stackoverflow.com/a/56698035/2891324 123
Hope it helps |
st206379 | Hi there,
I’m currently experimenting with TF.js.
Using the pre-packaged models is a real walk in the park. But when trying to load models (TF.js, TF Lite or from TF-hub) I seem to be getting an error while predicting:
The code I’m running is the following:
.then(() => {
return tf.loadGraphModel(
"https://storage.googleapis.com/tfjs-models/savedmodel/mobilenet_v2_1.0_224/model.json"
)
})
.then((model) => {
let img = tf.browser.fromPixels(document.getElementById("image"))
img = img.cast("float32").reshape([1, 224, 224, 3])
return model.predict(img)
})
.then((predictions) => {
console.log(predictions)
})```
I've tried using both `"@tensorflow/tfjs": "^3.5.0",` as well as `"@tensorflow/tfjs": "^3.6.0",`
I'm probably making a rookie mistake here. If anybody would be able to point me in the right direction it would be greatly appreciated! |
st206380 | Generally I suggest you to use tags on new thread cause specialized technical team members could be subscribed only to a tag subset (e.g. in this case tfjs and help_request tags). |
st206381 | Given the same model, I found that the calculated flops in pytorch and tensorflow are different. I used the keras_flops (keras-flops · PyPI 60) in tensorflow, and ptflops (ptflops · PyPI 32) in pytorch to calculate flops. It seems that flops in pytorch are closed to my own calculation by hands. Is that tensorflow has some tricks to speed up the computation so that few flops are measured? My model in tensorflow
d=56
s=12
inp = Input((750 ,750, 1))
x = Conv2D(d, (5,5), padding='same')(inp)
x = PReLU()(x)
x = Conv2D(s, (1,1), padding='valid')(x)
x = PReLU()(x)
x = Conv2D(s, (3,3), padding='same')(x)
x = PReLU()(x)
x = Conv2D(s, (3,3), padding='same')(x)
x = PReLU()(x)
x = Conv2D(s, (3,3), padding='same')(x)
x = PReLU()(x)
x = Conv2D(s, (3,3), padding='same')(x)
x = PReLU()(x)
x = Conv2D(d, (1,1), padding='same')(x)
x = PReLU()(x)
out = Conv2DTranspose(1 ,(9,9), strides=(4, 4),padding='same',output_padding = 3)(x)
My model in tensorflow
node name | # float_ops
Conv2D 8.92b float_ops (100.00%, 61.95%)
Conv2DBackpropInput 5.10b float_ops (38.05%, 35.44%)
Neg 180.00m float_ops (2.61%, 1.25%)
BiasAdd 105.75m float_ops (1.36%, 0.73%)
Mul 90.00m float_ops (0.63%, 0.63%)
======================End of Report==========================
The FLOPs is:14.3 GFlops
However, the FLops in pytorch is
Model_1(
0.013 M, 100.000% Params, 45.486 GMac, 100.000% MACs,
(begin): Sequential(
0.002 M, 11.804% Params, 0.851 GMac, 1.870% MACs,
(0): Conv2d(0.001 M, 11.367% Params, 0.819 GMac, 1.801% MACs, 1, 56, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
(1): PReLU(0.0 M, 0.437% Params, 0.032 GMac, 0.069% MACs, num_parameters=56)
)
(middle): Sequential(
0.007 M, 52.775% Params, 3.803 GMac, 8.360% MACs,
(0): Conv2d(0.001 M, 5.340% Params, 0.385 GMac, 0.846% MACs, 56, 12, kernel_size=(1, 1), stride=(1, 1))
(1): PReLU(0.0 M, 0.094% Params, 0.007 GMac, 0.015% MACs, num_parameters=12)
(2): Conv2d(0.001 M, 10.212% Params, 0.736 GMac, 1.618% MACs, 12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(3): PReLU(0.0 M, 0.094% Params, 0.007 GMac, 0.015% MACs, num_parameters=12)
(4): Conv2d(0.001 M, 10.212% Params, 0.736 GMac, 1.618% MACs, 12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(5): PReLU(0.0 M, 0.094% Params, 0.007 GMac, 0.015% MACs, num_parameters=12)
(6): Conv2d(0.001 M, 10.212% Params, 0.736 GMac, 1.618% MACs, 12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(7): PReLU(0.0 M, 0.094% Params, 0.007 GMac, 0.015% MACs, num_parameters=12)
(8): Conv2d(0.001 M, 10.212% Params, 0.736 GMac, 1.618% MACs, 12, 12, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(9): PReLU(0.0 M, 0.094% Params, 0.007 GMac, 0.015% MACs, num_parameters=12)
(10): Conv2d(0.001 M, 5.684% Params, 0.409 GMac, 0.900% MACs, 12, 56, kernel_size=(1, 1), stride=(1, 1))
(11): PReLU(0.0 M, 0.437% Params, 0.032 GMac, 0.069% MACs, num_parameters=56)
)
(final): ConvTranspose2d(0.005 M, 35.420% Params, 40.833 GMac, 89.770% MACs, 56, 1, kernel_size=(9, 9), stride=(4, 4), padding=(4, 4), output_padding=(3, 3))
)
Computational complexity: 45.49 GMac |
st206382 | Having an official tool It is a quite popular features request in TF.
github.com/tensorflow/tensorflow
TF 2.0 Feature: Flops calculation 119
opened
Sep 25, 2019
pzobel
TF 2.0
comp:tfdbg
type:feature
<em>Please make sure that this is a feature request. As per our [GitHub Policy](…https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template</em>
**System information**
- TensorFlow version (you are using): TF 2.0 RC2
- Are you willing to contribute it (Yes/No):
**Describe the feature and the current behavior/state.**
I am missing the opportunity to compute the number of floating point operations of a tf.keras Model in TF 2.0.
In TF 1.x tf.profiler was available [see here](https://stackoverflow.com/questions/45085938) but I can find anything equivalent for TF 2.0 yet.
**Will this change the current api? How?**
**Who will benefit with this feature?**
Everbody interested in the computational complexity of a TensorFlow model.
**Any Other info.**
In the meantime I think that you need to interact with these two third party projects repos about their specific implementations. |
st206383 | Thanks for reply.
I think the keras-flops · PyPI is call the official tools’ function.
Is that tensorflow has some tricks to speed up the computation so that few flops are measured? |
st206384 | I don’t know ptflops internals and It is using the GMacs metric.
You could try to give a run with FB semi-official flops tool like:
github.com
facebookresearch/fvcore/blob/master/docs/flop_count.md 44
# Flop Counter for PyTorch Models
fvcore contains a flop-counting tool for pytorch models -- the __first__ tool that can provide both __operator-level__ and __module-level__ flop counts together. We also provide functions to display the results according to the module hierarchy. We hope this tool can help pytorch users analyze their models more easily!
## Existing Approaches:
To our knowledge, a good flop counter for pytorch models that satisfy our needs do not yet exist. We review some existing solutions below:
### Count per-module flops in module-hooks
There are many existing tools (in [pytorch-OpCounter](https://github.com/Lyken17/pytorch-OpCounter), [flops-counter.pytorch](https://github.com/sovrasov/flops-counter.pytorch), [mmcv](https://github.com/open-mmlab/mmcv/blob/master/mmcv/cnn/utils/flops_counter.py), [pytorch_model_summary](https://github.com/ceykmc/pytorch_model_summary), and our own [mobile_cv](https://github.com/facebookresearch/mobile-vision/blob/master/mobile_cv/lut/lib/pt/flops_utils.py)) that count per-module flops using Pytorch’s [module forward hooks](https://pytorch.org/docs/stable/generated/torch.nn.Module.html?highlight=module%20hook#torch.nn.Module.register_forward_hook). They work well for many models, but suffer from the same limitation that makes it hard to get accurate results:
* They are accurate only if every custom module implements a corresponding flop counter. This is too much extra effort for users.
* In addition, determining the flop counter of a complicated module requires manual inspection of its forward code to see what raw ops are called. A refactor of the forward logic (replacing raw ops by submodules) might require a change in its flop counter.
* When a module contains control flow internally, the counting code has to replicate some of the module’s forward logic.
### Count per-operator flops
These limitations of per-module counting suggest that counting flops at operator level would be better: unlike a large set of custom modules users typically create, custom operators are much less common. Also, operators typically don’t contain control logic that needs to be replicated in its flop counter. For accurate results, operator-level counting is a more preferable approach.
This file has been truncated. show original |
st206385 | @markdaoust @jbgordon this thread leads me to request for a thorough tutorial on reporting of FLOPs, and similar metrics. |
st206386 | There’s too much going on in the initial post. Start by comparing individual layers, not whole models. That will make things easier to untangle.
My first impression is that you’re not measuring the same thing. Do we know why in the PT model 90% of the GMac comes from the final ConvTrtanspose2d layer, but that’s not listed for tensorflow?
“MAC” is “multiply-add-calculations”. The Conv2 layers are 9 Gflops (TF) or ~4.5 GMac (PT). 2:1 is the exchange rate. So that part makes sense. |
st206387 | Thanks for the clarification.
Yes the deconvolution is a bit weird.
I tried to calculate myself as follow
The flops for deconvolution is:
Cout * (1+Cin * k * k) * Hout * Wout
= 1 * (1+56 * 9 * 9) * 3000 * 3000
= 40.83 GFlops.
This value is closed to the pytorch calculated flops, but different to tensorflow did. |
st206388 | but if you look at softmax activation function. It contains the calculations for e to the power x.
So, that will be counted as FLOPS not MACs.
My understanding is one cannot divide FLOPS/2 to get MACs.
Please correct me if I am wrong |
st206389 | Yes I agree with you.
2FLops = MACs is a approximate estimation.
There will be a different depending on the model itself. |
st206390 | Does anyone think there is a miscalculation in my equation, since the tensorflow count_flops reporting a different answer?
Thanks |
st206391 | thin, the return of the revenge of “how one calculates a Flop”, I thought this debate exceeded with the tensor cores (it is true, the GPUs in question are missing), we are not in 1995 to wonder about the power real Cray T3E -1200 |
st206392 | Hi, I’m using Keras API for tabular data with embedding, conv1D and sequential with onehot encoding to get a merged model more efficient (after a concatenation layer). I’m very interesting in adding a Keras gradient boosting model but I guess it won’t be possible to get the output layer (and input) to concatenate multiple outputs and create a merged model ? It seems we can only fit the gradient model (without compile step) as any other gradient boosting models (Xgb, Lgb, Cat…). Do I miss something ? Thank you very much for your information
I read the intermediate colab page, but my question was about the gradient boosting model which is much more efficient than a random forest for tabular data.
In the page, It seems that only random forest can be concatenated with functional API . In addition, my understanding (but I need to go deeper in the example provided in the page) is that the training is performed in 2 steps (not in //). My objective is to use multiple heads made of functional API (head for embedding layer, head for Conv1D…) to compute a tabular dataset in // and concatenate the // heads into a final stream (still API) for a prediction ( with some dense layers and finally a softmax activation for example). Of course, a head with gradient boosting would improve the result of the concatenation.
I did it with a head made of Decision Forest model (from Keras deep_neural_decision_forests) but it was not very powerfull .
By the way, it seems (not important) that you should change vocabulary_size in the data pipeline by vocab_size because it leads to an error in google colab notebook. |
st206393 | Bonjour/Hello Laurent :),
To make it more visual, here is the model you describe as I understand it:
graphviz491×641 20.5 KB
(Assuming this is the model you describe), this configuration is possible, but there are some caveats:
The TF-DF models don’t backpropagate gradients (yet 4). It means that the parameters of the “Common learnable pre-processing” part cannot be trained through the GBT. Instead, the pre-processing needs be trained with the gradients back-propagated through the “model #1” and “model #2”.
This implies a 2 steps training:
Training of “Common learnable pre-processing” + “model #1” + “model #2”.
Training of “GBT model”.
If there are no “Common learnable pre-processing” stages, all the models (including the GBT) can be trained in parallel (i.e. in the same session call). However, this might not be optimal as GBT trains in exactly on epoch, while NNs generally train over multiple ones. Instead, it will be more interesting to train the GBT and the NN independently (but possibly at the same time).
This colab 18 demonstrates how to train the ensemble shown in the figure. I hope this helps. The API is a bit verbosy, but hopefully, this will improve :).
Cheers, |
st206394 | Hello @laurent_pourchot,
It is possible both to stack TF-DF “on top of existing” model (see intermediate colab 6) as well as to stack a model/set-of-operations (e.g. concatenate output) on top of a TF-DF (currently not demonstrated in a colab) using the Sequential or Functional Keras API. What’s important is that “fit” is called the TF-DF model. |
st206395 | Hello Mathieu,
You have understood my request and your picture is perfect. I also understand your very clear answer, thank you very much.
This kind of // configuration works with a decision Forest posted on Keras so I was dreaming of a better model such as gradient boosting.
Yesterday, I tested your model from the tuto but with 50 features and 100 000 rows (50 inputs layers in a loop) concatenated +3 Dense layers + softmax with multiclass and then a layer ( not the final softmax) into the gradient model argument. It works but overfit quickly ( even with the early stopping in the gradient model and a callback in the functiional API).
Thank you again for your explanations and I hope for a future gradient model to make NN + trees more efficient on tabular structured data. ( atention layers and tabnet gives also poor result in comparison to gradient). |
st206396 | Tools like Keras Tuner or Hyperas require to modify the code. For large applications, this can be quite cumbersome, especially w.r.t. parameters that are not part of the model itself (e.g. settings for data preprocessing). Moreover, it complicates maintenance of the code base (development vs. production). For this reason, I’m looking for a minimally invasive hyperparameter tuner that works at the level of executables / scripts and passes parameters via command line arguments. Any hints or ideas? Thanks a lot! |
st206397 | Have you already evalauted TFX timer?
TensorFlow
The Tuner TFX Pipeline Component | TensorFlow 7 |
st206398 | Hello everyone,
I am trying to load the efficientnet-l2-nasfpn w/ self-training model in this repo:
github.com
tensorflow/tpu 2
master/models/official/detection/projects/self_training
Reference models and tools for Cloud TPUs. Contribute to tensorflow/tpu development by creating an account on GitHub.
When loading the config file with model = tf.keras.models.model_from_yaml("path/to/config.yaml"), I get the following error: Improper config format: {'architecture': {'parser': .....
Am I doing something wrong? |
st206399 | I wish we would have working grouped transposed convolutions. We waited for a long time to have (standard) grouped convolution in TF when it had been available in other frameworks for quite a while. We don’t need to set some kind of tradition over this. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.