text:
Using metric SparseTopKCategoricalAccuracy on an RNN results in rank mismatch

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes. The code is given below to reproduce the issue.

OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
Linux Ubuntu 18.04

TensorFlow installed from (source or binary):
Binary, using pip

TensorFlow version:
v2.0.0-rc2-26-g64c3d38 2.0.0

Python version:
3.6

CUDA/cuDNN version:
10.1 / 7.6.2

GPU model and memory:
GeForce GTX 1070 / 8GB

Describe the current behavior
When I compile an RNN model with the metric SparseTopKCategoricalAccuracy(), the following error results. No error occurs if I use SparseCategoricalAccuracy() instead.
Traceback (most recent call last):
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1610, in _create_c_op
    c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 2 but is rank 3 for 'metrics/sparse_top_k_categorical_accuracy/in_top_k/InTopKV2' (op: 'InTopKV2') with input shapes: [?,?,10], [?,?], [].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "report.py", line 12, in <module>
    metrics=[tf.keras.metrics.SparseTopKCategoricalAccuracy()])
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/training/tracking/base.py", line 457, in _method_wrapper
    result = method(self, *args, **kwargs)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 366, in compile
    masks=self._prepare_output_masks())
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 2063, in _handle_metrics
    target, output, output_mask))
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 2014, in _handle_per_output_metrics
    metric_fn, y_true, y_pred, weights=weights, mask=mask)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_utils.py", line 1067, in call_metric_function
    return metric_fn(y_true, y_pred, sample_weight=weights)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/metrics.py", line 193, in __call__
    replica_local_fn, *args, **kwargs)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/distribute/distributed_training_utils.py", line 1135, in call_replica_local_fn
    return fn(*args, **kwargs)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/metrics.py", line 176, in replica_local_fn
    update_op = self.update_state(*args, **kwargs)  # pylint: disable=not-callable
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/utils/metrics_utils.py", line 75, in decorated
    update_op = update_state_fn(*args, **kwargs)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/metrics.py", line 581, in update_state
    matches = self._fn(y_true, y_pred, **self._fn_kwargs)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/metrics.py", line 2805, in sparse_top_k_categorical_accuracy
    nn.in_top_k(y_pred, math_ops.cast(y_true, 'int32'), k), K.floatx())
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/ops/nn_ops.py", line 4843, in in_top_k
    return gen_nn_ops.in_top_kv2(predictions, targets, k, name=name)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_nn_ops.py", line 5043, in in_top_kv2
    "InTopKV2", predictions=predictions, targets=targets, k=k, name=name)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/op_def_library.py", line 793, in _apply_op_helper
    op_def=op_def)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/func_graph.py", line 548, in create_op
    compute_device)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3429, in _create_op_internal
    op_def=op_def)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1773, in __init__
    control_input_ops)
  File "/home/pi/venv/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1613, in _create_c_op
    raise ValueError(str(e))
ValueError: Shape must be rank 2 but is rank 3 for 'metrics/sparse_top_k_categorical_accuracy/in_top_k/InTopKV2' (op: 'InTopKV2') with input shapes: [?,?,10], [?,?], [].

Describe the expected behavior
I expect no error. I suppose SparseTopKCategoricalAccuracy() can be used in exactly the same way as SparseCategoricalAccuracy().
Code to reproduce the issue
import numpy as np
import tensorflow as tf
from tensorflow.keras import layers

model = tf.keras.Sequential([
    layers.Embedding(input_dim=1000, output_dim=64),
    layers.LSTM(128, return_sequences=True),
    layers.Dense(10, activation='softmax')])

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=[tf.keras.metrics.SparseTopKCategoricalAccuracy()])

data = np.random.randint(0, 1000, (32, 10))  # batch_size=32, seq_length=10
labels = np.random.randint(0, 10, (32, 10))

model.fit(data, labels, epochs=1, batch_size=32)

Other info / logs
I use this custom metric to get around the problem:
class InTopK(tf.keras.metrics.Mean):
    def __init__(self, k, name='in_top_k', **kwargs):
        super(InTopK, self).__init__(name=name, **kwargs)
        self._k = k

    def update_state(self, y_true, y_pred, sample_weight=None):
        matches = tf.nn.in_top_k(
            # flatten tensors
            tf.reshape(tf.cast(y_true, tf.int32), [-1]),
            tf.reshape(y_pred, [-1, y_pred.shape[-1]]),
            k=self._k)

        return super(InTopK, self).update_state(
            matches, sample_weight=sample_weight)

I have tried on colab with TF version 2.0 ,2.1.0-dev20191029 and was able to reproduce the issue.Please, find the gist here. Thanks!

I was able to reproduce the issue, working on a fix.

I have submitted a fix for this now, please try it out and let us know if things look good. Thank you!

@nickoala Looks like the fix by @pavithrasv resolved the issue. I ran your code with tf-nightly and I cannot reproduce the issue. Please check the gist here. Thanks!
I am closing this issue as it was resolved. Please feel free to reopen if the issue persists again. Thanks!

@jvishnuvardhan and @pavithrasv, thank you very much. I am satisfied with the fix. Thanks for the work.

authors: jvishnuvardhan nickoala pavithrasv ravikyram


text:
Gradient in keras model with respect to layer outputs is None when layer is a Model

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): centos-release-7-6.1810.2.el7.centos.x86_64

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:

TensorFlow installed from (source or binary): Binary

TensorFlow version (use command below): 2.1.0

Python version: 3.7.4

Bazel version (if compiling from source):

GCC/Compiler version (if compiling from source):

CUDA/cuDNN version:

GPU model and memory:

Describe the current behavior
I want to obtain the gradients of a network's output with respect to an intermediate layer which is itself a keras Model. This returns None.
Describe the expected behavior
It should return something other than None.
Code to reproduce the issue
import tensorflow as tf

input = tf.keras.layers.Input(shape=(28,28))

x = tf.keras.layers.Flatten()(input)
x = tf.keras.layers.Dense(128)(x)
x = tf.keras.layers.ReLU()(x)
x = tf.keras.layers.Dense(10)(x)

small_model = tf.keras.models.Model(inputs=[input], outputs=[x])

y = small_model(input)

y = tf.keras.layers.Dense(20)(y)
y = tf.keras.layers.Dense(30)(y)
y = tf.keras.layers.Dense(10)(y)

big_model = tf.keras.models.Model(inputs=[small_model.input], outputs=[y])

ext_model = tf.keras.models.Model(inputs=[small_model.input], outputs=[big_model.output,  big_model.layers[1].output])

images = tf.random.uniform(shape=(32,28,28))
labels = tf.zeros(shape=(32,))

with tf.GradientTape() as tape:
    predictions, layer = ext_model(images)

print("grad = ", tape.gradient(predictions, layer))

Other info / logs
Changing to ext_model = tf.keras.models.Model(inputs=[small_model.input], outputs=[big_model.output,  big_model.layers[2].output]) outputs a gradient different from None, which indicates that the problem occurs only when the layer in question is a Model itself. But this is precisely the typical use case scenario, where one needs gradients with respect to the outputs of an intermediate layer of a pre-built tf.keras.applications model.
This issue is related (but not identical) to https://github.com/tensorflow/tensorflow/issues/33478 which doesn't seem to have been adequately addressed.

Was able to reproduce the issue. Please find the Gist here. Thanks!

You can see the problem more clearly when you visualize the graph on TensorBoard, here's a gist. Specifically expand the ext_model node. In the big_model.layers[1].output case, the predictions and layer are in two different branches of the graph, so there is no gradient of prediction with respect to layer. In the big_model.layers[2].output case, there is a path between the two nodes, so there is a gradient. This has to do with how tf.keras copies the sub-model's ops when you create another model with it.
I'm not sure how to resolve this issue but hopefully this sheds some light on it.

@ksabr Is this still an issue? Please close the issue If this was already resolved. Thanks!

source: gharchive/issue

authors: amahendrakar jvishnuvardhan ksabr n2cholas

repo: tensorflow/tensorflow

license_type: permissive

license_source: github-api


text:
keras.models.save_model does not respect include_optimizer option

System information
Tensorflow: v2.2.0-0-g2b96f3662b 2.2.0
Describe the current behavior
When passing include_optimizer=False to  keras.models.save_model the optimizers weights are included.
Describe the expected behavior
When passing include_optimizer=False to  keras.models.save_model the optimizers weights are NOT included.
Standalone code to reproduce the issue
https://colab.research.google.com/drive/1JocUwWRNmGQzE4mbL85YO-DAaVilJmlD?usp=sharing

@philipp-eisen
I have tried in colab with TF 2.2 , nightly version.PLease, find the gist here.Is this the expected behavior?.Thanks!

@ravikyram Thanks for checking this issue out.
Unfortunately, this is not the the expected behavior. I added a workaround to the original colab that produces the expected behavior.
So basically just setting the optimizer property to None, without compiling the model does not remove the optimizer weights. (This is what happens in the implementation that is supposed to handle include_optimizer=False) see here

@fchollet I think this should not be stale.

Today, I found it too, when after a big model (e.g. BERT) trained, Adam's weights could be larger than model's weights ! (700MB of adams, 400MB of bert it self)
A simple reproduce work: https://colab.research.google.com/drive/1TyFfOi71njrgO8ybWRB5AlHcRHfKOhlv?usp=sharing
A little trick is replace model's optimizer before you save:
 old_opt = model.optimizer
 model.optimizer = tf.keras.optimizers.SGD()

 model.save(save_to, include_optimizer=False)

model.optimizer = old_opt

Today, I found it too, when after a big model (e.g. BERT) trained, Adam's weights could be larger than model's weights ! (700MB of adams, 400MB of bert it self)
A simple reproduce work: https://colab.research.google.com/drive/1TyFfOi71njrgO8ybWRB5AlHcRHfKOhlv?usp=sharing
A little trick is replace model's optimizer before you save, if you really don't care the optimizer:
old_opt = model.optimizer
# it WORKS, you have to assign a object which a sub-class of tf.keras.optimizers.Optimizer
model.optimizer = tf.keras.optimizers.SGD()
model.save(save_to, include_optimizer=False)
model.optimizer = old_opt

old_opt = model.optimizer
# it NOT works!
model.optimizer = None
model.save(save_to, include_optimizer=False)
model.optimizer = old_opt

This trick works.
My previous walkaround was manually removing 'optimizer' from 'model._unconditional_checkpoint_dependencies'. Apparently, assigning a new optimizer looks much better.
The other trick with clone_model() is nice too, but only if the model is built with functional or sequential (not subclass).

I also encounter this issue which makes a fine-tuned bert model 1.2G.
As Philipp said, this issue makes tf.keras API not usable for production.

We are also having this problem. We moved from TF 1.15 + estimator to TF 2.3 + Keras and our model variables went from 200MB to 600MB. The extra 400MB was all the momentum and velocity variables from the ADAM optimizer. Unfortunately 600MB exceeds AI platform's model size limit so we can't put it into production.

We are also having this problem. We moved from TF 1.15 + estimator to TF 2.3 + Keras and our model variables went from 200MB to 600MB. The extra 400MB was all the momentum and velocity variables from the ADAM optimizer. Unfortunately 600MB exceeds AI platform's model size limit so we can't put it into production.

This has been fixed with commit https://github.com/tensorflow/tensorflow/commit/5931dc3cb388063c1512b16e1b90f579a012f91c
The optimizer slot variables in @philipp-eisen 's colab go away when running it with
!pip -q uninstall -y tensorflow
!pip -q install 'tf-nightly==2.5.0.dev20210225'

Closing this issue now, as the fix has been verified!

authors: a7744hsc acarl005 arnoegw monicadsong philipp-eisen qhduan ravikyram vxacezxcv


text:
How to start JupyterLab in a virtual environment

Could you please tell me how to start JupyterLab in a virtual environment?
I use Windows 10 and have already installed Anaconda 64 bit.
I failed to install tensorflow in the base environment. Therefore, I created a virtual environment where tensorflow was  installed, by writing the following command on Anaconda prompt.
conda create -n tf2 tensorflow python=3.7
With this command, I created the virtual environment succesfully.
Then, I wrote the following command on the activated virtual environment:
(tf2) conda install -c conda-forge jupyter lab
Finally, I wrote this command:
jupyter lab
However, JupyterLab did not start.
Could you please teach me what I should do?

@momohina,
This question is better asked on StackOverflow since it is not a TensorFlow bug or feature request. There is also a larger community that reads questions there. Thanks!

Thank you very much for advice!
I am going to ask the question on StackOverflow.

authors: amahendrakar momohina


text:
Tensorboard hparams plugin API reports final epoch metrics, val loss, not from epoch with min val loss

System information

TensorFlow version:  2.3.0
Are you willing to contribute it:  Yes, with guidance/help to know where to look

Describe the feature and the current behavior/state.
Feature would change current behavior of Tensorboard.  Current behavior is that Tensorboard displays the validation loss from the final epoch of training, which is not useful when comparing different models to each other.
Will this change the current API? How?
This will change tensorboard.plugins.hparams.api to report the performance of the best training epoch, not just the final epoch.  Since the purpose of validation is to detect overfitting, this is in line with the reasons for performing it.
Who will benefit with this feature?
Everyone who uses Tensorboard to compare models to each other based on the performance of the best training epoch.
Any Other info.
I am currently using a standard tf.keras.callbacks.Tensorboard instance, sub-classed with the following method as the only modification:
    def on_train_end(self, logs=None):
        if os.path.exists(os.path.join(self.log_dir, "train", "plugins")):
            shutil.rmtree(os.path.join(self.log_dir, "train", "plugins"))

I am also creating a callback with the following code:
from tensorboard.plugins.hparams import api as hp
hp.hparams_config(
    hparams=hparams_list,
    metrics=[hp.Metric(CategoricalAccuracy().name, display_name=CategoricalAccuracy().name)],
)
hp_callback = hp.KerasCallback(writer=output_dir, hparams=session_hparams)

@brethvoice,
Can you please share the code corresponding to the statement,

Current behavior is that Tensorboard displays the validation loss from the final epoch of training.

so that it helps us to reproduce the issue better and understand exactly what is missing.
Thanks!

@brethvoice,
Can you please share the code corresponding to the statement,

Current behavior is that Tensorboard displays the validation loss from the final epoch of training.

so that it helps us to reproduce the issue better and understand exactly what is missing.
Thanks!

The code is nearly 300 lines, so I posted it to my only Github repo.  It can be run from Windows 10 using local GPU if available.

Thanks for this feature request.  It seems reasonable to want to see the "best" (maximum or minimum) value of a particular metric in the table UI at a glance, rather than just the value from the final epoch/step.
If I understand how the Hparams dashboard works, the metric names are linked with series line charts shown in the Scalar dashboard.  If that is the case, and the scalar + hparam data are already plumbed to TensorBoard today, I think this might not need any API related changes.  As such, this might only require frontend fixes.

Thanks for this feature request.  It seems reasonable to want to see the "best" (maximum or minimum) value of a particular metric in the table UI at a glance, rather than just the value from the final epoch/step.
If I understand how the Hparams dashboard works, the metric names are linked with series line charts shown in the Scalar dashboard.  If that is the case, and the scalar + hparam data are already plumbed to TensorBoard today, I think this might not need any API related changes.  As such, this might only require frontend fixes.

authors: brethvoice psybuzz rmothukuru


text:
No visible @interface for 'TFLInterpreter' declares the selector 'copyData:toInputTensorAtIndex:error:'

Hello, I have a little problem with the tensorflow documentation.
I would like to use tensorflow lite with Objective C by following this documentation
URL(s) with the issue:
https://www.tensorflow.org/lite/guide/inference
Description of issue (what needs changing):
Apparently this function is not declared:
[interpreter copyData:inputData toInputTensorAtIndex:0 error:&error];
I got this following error:
No visible @interface for 'TFLInterpreter' declares the selector 'copyData:toInputTensorAtIndex:error:'
Am I missing something, how can I fill a tensor with objective C ?

@yyoon could you take a look?

I think I have it.
We need to apply copyData on a TFLTensor object, not the TFLInterpreter like this:
NSMutableData *inputData;  // Should be initialized
TFLTensor *inputTensor = [interpreter inputTensorAtIndex:0 error:&error];

//Feed data
[inputTensor copyData:inputData error:&error]

Am I correct ?

@Fedour Thanks for reporting! You are correct on that.
Will update the inference guide doc.

authors: Fedour abattery yyoon


text:
Question on implicit transpose in HLO bitcast/copy/reshape instruction

HLO instructions like bitcast/copy/reshape often conduct implicit transpose. I am confusing on how the reshape/transpose performed exactly, as I am not aware of they are documented anywhere else including official operation semantics.
Take tensor A[2,3]{1,0} as an example, suppose tensor A have element [[1,2,3], [4,5,6]] with memory layout [1,2,3,4,5,6], consider following two transposition performed by bitcast/copy/reshape:

%bitcast = f32[2,3]{0,1} bitcast(f32[2,3]{1, 0} %A)
we get tensor elements [[1,2,3], [4,5,6]] with memory layout [1,4,2,5,3,6]
%bitcast = f32[3,2]{0,1} bitcast(f32[2,3]{1, 0} %A)
For this case both tensor shape and memory layout are permutes, I suppose technically tensor A first reshape to [3,2] (get [3,2]{1,0}), then permute memory layout to get the final result.
So the process would be [[1,2,3], [4,5,6]] [1,2,3,4,5,6]  --reshape--> [[1,2],[3,4],[5,6]] [1,2,3,4,5,6] --transpose--> [[1,2],[3,4],[5,6]] [1,3,5,2,4,6]

Am I understanding implicit transpose correctly?
Thanks a lot:)

@donglinz We see that there is another issue #53650 which we are tracking. Could you please confirm if it is  a duplicate ticket and close this one so that we can get you the right help in other issue ?Thank you!

Hi @sushreebarsa, it not a duplicated ticket. Two issues are both targeting hlo bitcast instruction however the question are unique.

@donglinz   Thank you for the update!
Could you please refer to bitcast,operation_semantics and this thread ,please let us know if it helps?Thanks!

authors: donglinz sushreebarsa


text:
Autograph appears not to support Python variables without an initial value

Click to expand!
Issue Type
Bug
Source
binary
Tensorflow Version
2.8.0
Custom Code
Yes
OS Platform and Distribution
Ubuntu 18.04.6 LTS
Mobile device
No response
Python version
3.10.4
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current Behaviour?
Autograph appears not to support Python variables without an initial value.
Although this is a rarely used feature of Python, I don't see why this should cause any problems. It literally has no control flow.

In my below example `foo` works, but `bar` does not, despite them essentially only having formatting differences.

Standalone code to reproduce the issue
import tensorflow as tf

@tf.function
def foo(a: tf.Tensor, b: tf.Tensor) -> tf.Tensor:
    result: tf.Tensor = a + b
    return result

@tf.function
def bar(a: tf.Tensor, b: tf.Tensor) -> tf.Tensor:
    result: tf.Tensor
    result = a + b
    return result

foo(tf.constant(2), tf.constant(3))  # <-- Works.
bar(tf.constant(2), tf.constant(3))  # <-- WARNING:tensorflow:AutoGraph could not transform...

Relevant log output
2022-05-09 10:25:03.704416: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2022-05-09 10:25:03.707662: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusolver.so.11'; dlerror: libcusolver.so.11: cannot open shared object file: No such file or directory
2022-05-09 10:25:03.708246: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2022-05-09 10:25:03.708548: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING:tensorflow:AutoGraph could not transform <function bar at 0x7feba9ff7130> and will run it as-is.
Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.
Cause: invalid value for "node": expected "ast.AST", got "<class 'NoneType'>"; to visit lists of nodes, use "visit_block" instead
To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 427, in converted_call
    converted_f = _convert_actual(target_entity, program_ctx)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 269, in _convert_actual
    transformed, module, source_map = _TRANSPILER.transform(entity, program_ctx)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/transpiler.py", line 282, in transform
    return self.transform_function(obj, user_context)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/transpiler.py", line 466, in transform_function
    nodes, ctx = super(PyToPy, self).transform_function(fn, user_context)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/transpiler.py", line 359, in transform_function
    result = self.transform_ast(node, context)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 237, in transform_ast
    node = self.initial_analysis(node, ctx)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py", line 225, in initial_analysis
    node = activity.resolve(node, ctx, None)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/static_analysis/activity.py", line 700, in resolve
    return ActivityAnalyzer(context, parent_scope).visit(node)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/transformer.py", line 441, in visit
    result = super(Base, self).visit(node)
  File "/usr/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/static_analysis/activity.py", line 592, in visit_FunctionDef
    node.body = self.visit_block(node.body)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/transformer.py", line 336, in visit_block
    replacement = self.visit(node)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/transformer.py", line 441, in visit
    result = super(Base, self).visit(node)
  File "/usr/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/static_analysis/activity.py", line 385, in visit_AnnAssign
    node.value = self.visit(node.value)
  File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/pyct/transformer.py", line 427, in visit
    raise ValueError(msg)
ValueError: invalid value for "node": expected "ast.AST", got "<class 'NoneType'>"; to visit lists of nodes, use "visit_block" instead

@jesnie  It is solved in the next release (try TF 2.9rc2).
Please note also that usually the fix in the older versions (<=1 year) will be done if that is a security bug or if the bug is critical and impacting larger community. In this case it is working fine or not reproducible with Tensorflow 2.9.x you need to use the last RC or wait for the 2.9 stable release.

Hmmm, it does appear that this has already been fixed for 2.9.0. Thanks!

authors: bhack jesnie


text:
GpuCudaMallocAsyncAllocator fails if the same GPU device is initialised multiple times

Click to expand!
Issue Type
Bug
Source
source
Tensorflow Version
tf 2.7.1
Custom Code
No
OS Platform and Distribution
No response
Mobile device
No response
Python version
No response
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
CUDA 11.2, cuDNN 8.1.1
GPU model and memory
NVIDIA GTX 1080
Current Behaviour?
When https://github.com/tensorflow/tensorflow/blob/v2.7.1/tensorflow/core/common_runtime/gpu/gpu_cudamallocasync_allocator.cc#L391 is used instead of the default one (either via environment variable or config setting), and the same GPU device is initialised more than once (e.g. if there are multiple TensorFlow session within a single process) it fails with the "Trying to set the stream twice. This isn't supported." error.
Apparently this is happening, because the GpuCudaMallocAsyncAllocator is global and it's cuda_stream_ field is filled on the first SetStreamAndPreallocateMemory. I was able to fix this by making some changes in the code, and I am going to submit a PR containing those.
Standalone code to reproduce the issue
#include <tensorflow/core/public/session.h>

tensorflow::GraphDef graph_def2;

auto options = tensorflow::SessionOptions();
options.config.mutable_gpu_options()->mutable_experimental()->set_use_cuda_malloc_async(true);

tensorflow::GraphDef graph_def1;
// Load graph_def1
tensorflow::Session* session1 = nullptr;
tensorflow::NewSession(options, &session1);
session1->Create(graph_def1);

tensorflow::GraphDef graph_def2;
// Load graph_def2
tensorflow::Session* session2 = nullptr;
tensorflow::NewSession(options, &session2);
session2->Create(graph_def2);

Relevant log output
2022-05-17 14:17:05.253418: I tensorflow/core/common_runtime/gpu/gpu_process_state.cc:214] Using CUDA malloc Async allocator for GPU: 0
2022-05-17 14:17:05.253515: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 7234 MB memory:  -> device: 0, name: NVIDIA GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1
2022-05-17 14:17:05.422828: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 7234 MB memory:  -> device: 0, name: NVIDIA GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1
2022-05-17 14:17:05.423011: F tensorflow/core/common_runtime/gpu/gpu_cudamallocasync_allocator.cc:390] Trying to set the stream twice. This isn't supported.

Hello @dev0x13 ,
The PR has been assigned for reviewing and once it is merged this issue will move to closed status.Thank you!


text:
TF.dataset.cache(path) still uses memory despite the cache file path

Click to expand!
Issue Type
Bug
Source
binary
Tensorflow Version
v2.9.0-rc2-42-g8a20d54a3c1 2.9.0
Custom Code
No
OS Platform and Distribution
Ubuntu
Mobile device
No response
Python version
3.8
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
11.2 8.1
GPU model and memory
No response
Current Behaviour?
dataset.cache(path) uses the internal ram memory, which keeps increasing. At the same time, it also uses a local cache. In the discussion: https://discuss.tensorflow.org/t/tf-dataset-cache-path-still-uses-memory-despite-the-cache-file-path-is-given-in-tf2-5-2-8/8176?u=roshan

Standalone code to reproduce the issue
dataset = tf.data.Dataset.from_generator(generator,output_types=(tf.string, tf.float32),
                                            output_shapes=((),(num_cls,)))
dataset = dataset.map(parse_function, num_parallel_calls=AUTOTUNE)
dataset = dataset.cache(path)
dataset = dataset.map(applyMask, num_parallel_calls=AUTOTUNE)
dataset = dataset.shuffle(SHUFFLE_BUFFER_SIZE)

Relevant log output
No response

@roshan2908
In order to expedite the trouble-shooting process, please provide a complete code snippet to reproduce the issue reported here. Thank you!

import numpy as np
import tensorflow as tf

def train_generator():
    for file in trainfiles:
        x = np.random.rand(640,640,3)
        y = np.random.randint(0,2)
        yield x,y

dataset = tf.data.Dataset.from_generator(train_generator,output_types=(tf.float32, tf.float32),
                                            output_shapes=((640,640,3),()))
dataset = dataset.cache('./tmp/cache')
iterator = dataset.as_numpy_iterator()

while True:
    x,y = iterator.next()

Here is the code snippet for the same.
This will create a local cache file while at the same time it will increase the ram memory.

@roshan2908 Thank you for the update!
Reopening this issue. Thank you!

@roshan2908 Could you confirm if this is the complete code snippet to replicate the issue. I tried to replicate the issue here, please confirm the gist and let me know if I'm missing something to reproduce the issue?
Thank you!

I am not able to reproduce the same on colab. Seems like it might be because of different version of keras.
So uninsatalled keras and installed it again, it worked for me.
pip uninstall keras
pip install keras --upgrade

Hi @roshan2908, Tf v2.9.0-rc2-42-g8a20d54a3c1 2.9.0 is not stable version, may break due to version compatibility. Tf v2.9.0-rc2 is pre-release version. Latest stable Tensorflow  2.9.1 version is compatible with Keras 2.9.0. Thank you!

authors: gadagashwini roshan2908 sushreebarsa


text:
Tensorflow lite for microcontroller. VAR_HANDLE requires resource variables.

Click to expand!
Issue Type
Bug
Source
source
Tensorflow Version
tf 2.9
Custom Code
Yes
OS Platform and Distribution
ubuntu20
Python version
3.9
A bug happened!
When I run this code
TfLiteTensor* input1 = interpreter1.input(0);

the console return the following text:

VAR_HANDLE requires resource variables. Please create ResourceVariables and pass it to the interpreter.
Node VAR_HANDLE (number 1f) failed to prepare with status 1

I have two tflite models.One of them is OK, but the other cannot run and return this text.
However, I have no problem running both with tensorflow Lite

Standalone code to reproduce the issue
const tflite::Model* model1 = ::tflite::GetModel(CDEC_1_1600_Zz_tflite);
  if (model1->version() != TFLITE_SCHEMA_VERSION) {
    TF_LITE_REPORT_ERROR(&micro_error_reporter,
                         "Model provided is schema version %d not equal "
                         "to supported version %d.\n",
                         model1->version(), TFLITE_SCHEMA_VERSION);
  }

  tflite::AllOpsResolver micro_op_resolver;
  // Build an interpreter to run the model with.
  tflite::MicroInterpreter interpreter1(model1, micro_op_resolver, tensor_arena,
                                       tensor_arena_size,
                                       &micro_error_reporter);
  interpreter1.AllocateTensors();

  // Get information about the memory area to use for the model's input.
  TfLiteTensor* input1 = interpreter1.input(0);
  TfLiteTensor* input2 = interpreter1.input(1);
  TfLiteTensor* input3 = interpreter1.input(2);
  TfLiteTensor* input4 = interpreter1.input(3);
  TfLiteTensor* input5 = interpreter1.input(4);
  TfLiteTensor* input6 = interpreter1.input(5);

Relevant log output
VAR_HANDLE requires resource variables. Please create ResourceVariables and pass it to the interpreter.
Node VAR_HANDLE (number 1f) failed to prepare with status 1

Here are the two models.
https://drive.google.com/drive/folders/1UxQ7P9pVXuE79shGBIIyPI7wgY_FHYwJ?usp=sharing
CDEC_1_1600_Zz.tflite has problem.
model_1.tflite has no problem.

Hi @FragrantRookie !
Sorry for the late response. Could you check below code and let us know the results
static tflite::MicroErrorReporter micro_error_reporter;
 error_reporter = &micro_error_reporter;

 // Say something to test error reporter
 error_reporter->Report("STM32 TensorFlow Lite test");

 // Map the model into a usable data structure
 model = tflite::GetModel(<yourmodel>);
 if (model->version() != TFLITE_SCHEMA_VERSION)
 {
   error_reporter->Report("Model version does not match Schema");
   while(1);
 }

 // Pull in only needed operations (should match NN layers). Template parameter
 // <n> is number of ops to be added. Available ops:
 // tensorflow/lite/micro/kernels/micro_ops.h
 static tflite::MicroMutableOpResolver<1> micro_op_resolver;

 // Add dense neural network layer operation
 tflite_status = micro_op_resolver.AddBuiltin(
     tflite::BuiltinOperator_FULLY_CONNECTED,
     tflite::ops::micro::Register_FULLY_CONNECTED());
 if (tflite_status != kTfLiteOk)
 {
   error_reporter->Report("Could not add FULLY CONNECTED op");
   while(1);
 }

 // Build an interpreter to run the model with.
 static tflite::MicroInterpreter static_interpreter(
     model, micro_op_resolver, tensor_arena, kTensorArenaSize, error_reporter);
 interpreter = &static_interpreter;

 // Allocate memory from the tensor_arena for the model's tensors.
 tflite_status = interpreter->AllocateTensors();
 if (tflite_status != kTfLiteOk)
 {
   error_reporter->Report("AllocateTensors() failed");
   while(1);
 }

 // Assign model input and output buffers (tensors) to pointers
 input1 = interpreter->input(0);
 input2 = interpreter->input(1);
 input3 = interpreter->input(2);
 input4= interpreter->input(3);

Reference.

Ok，I will try it.
---Original---
From: @.>
Date: Sat, Jul 30, 2022 16:47 PM
To: @.>;
Cc: @.@.>;
Subject: Re: [tensorflow/tensorflow] Tensorflow lite for microcontroller.VAR_HANDLE requires resource variables. (Issue #56932)
Hi @FragrantRookie !
Sorry for the late response. Could you check below code and let us know the results
static tflite::MicroErrorReporter micro_error_reporter;  error_reporter = &micro_error_reporter;  // Say something to test error reporter  error_reporter->Report("STM32 TensorFlow Lite test");  // Map the model into a usable data structure  model = tflite::GetModel(<yourmodel>);  if (model->version() != TFLITE_SCHEMA_VERSION)  {    error_reporter->Report("Model version does not match Schema");    while(1);  }  // Pull in only needed operations (should match NN layers). Template parameter  // <n> is number of ops to be added. Available ops:  // tensorflow/lite/micro/kernels/micro_ops.h  static tflite::MicroMutableOpResolver<1> micro_op_resolver;  // Add dense neural network layer operation  tflite_status = micro_op_resolver.AddBuiltin(      tflite::BuiltinOperator_FULLY_CONNECTED,      tflite::ops::micro::Register_FULLY_CONNECTED());  if (tflite_status != kTfLiteOk)  {    error_reporter->Report("Could not add FULLY CONNECTED op");    while(1);  }  // Build an interpreter to run the model with.  static tflite::MicroInterpreter static_interpreter(      model, micro_op_resolver, tensor_arena, kTensorArenaSize, error_reporter);  interpreter = &static_interpreter;  // Allocate memory from the tensor_arena for the model's tensors.  tflite_status = interpreter->AllocateTensors();  if (tflite_status != kTfLiteOk)  {    error_reporter->Report("AllocateTensors() failed");    while(1);  }  // Assign model input and output buffers (tensors) to pointers  input1 = interpreter->input(0);  input2 = interpreter->input(1);  input3 = interpreter->input(2);  input4= interpreter->input(3);
Reference.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

Maybe my version is different from yours. I need to modify some codes in order not to report errors.
When I run the following code：
	 tflite_status = micro_op_resolver.AddBuiltin(
	     tflite::BuiltinOperator_FULLY_CONNECTED,
	     tflite::ops::micro::Register_FULLY_CONNECTED());

the following error message appears：
error: ‘Register_FULLY_CONNECTED’ is not a member of ‘tflite::ops::micro’; did you mean ‘tflite::Register_FULLY_CONNECTED’?

I think of a question. If I open the tflite model with netron, a callonce will be displayed in it.

@FragrantRookie !
Thanks for the update.
@sachinprasadhs !
Could you please look at this issue.
Thank you!

@mohantym @sachinprasadhs
Thank you.
It has been solved by myself.
When using GRU or LSTM,the tflite will contains VAR_HANDLE layers.To avoid using VAR_HANDLE,the GRU or LSTM should set unroll=True,and stateful=False.

@mohantym @sachinprasadhs
Thank you.
It has been solved by myself.
When using GRU or LSTM,the tflite will contains VAR_HANDLE layers.To avoid using VAR_HANDLE,the GRU or LSTM should set unroll=True,and stateful=False.

authors: FragrantRookie mohantym


text:
XLA JIT compile failing on TF 2.9.2, A100 GPUs (on GCP VMs)

Click to expand!
Issue Type
Bug
Source
binary
Tensorflow Version
2.9.2
Custom Code
Yes
OS Platform and Distribution
Debian GNU/Linux 10 (buster)
Mobile device
No response
Python version
3.7.12
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
11.3/8
GPU model and memory
A100, 80GB
Current Behaviour?
Till a few weeks ago, I was able to successfully use XLA compilation when training with GPUs on GCP VMs.
Specifically, I used `compile_jit=True` when doing a model.compile() for a TF Keras model. Having trained my models, I didn't run any TF training jobs for a while. Recently (a week ago) I tried running the same models, but the code now complains that it cannot find libcudnn.so.8. The same code works without `compile_jit=True`, but that does require a slightly smaller batch size to fit in memory.

The log with `compile_jit=True` says "Could not load library libcudnn_cnn_train.so.8", but that library is most definitely present, since the same code does work without using XLA JIT compilation.

Standalone code to reproduce the issue
Unable to provide a small case, haven't been able to reproduce on small models.

Relevant log output
Could not load library libcudnn_cnn_train.so.8. Error: /opt/conda/bin/../lib/./libcudnn_ops_train.so.8: symbol _Z22cudnnGenericOpTensorNdILi3EE13cudnnStatus_tP12cudnnContext16cudnnGeneric
Op_t21cudnnNanPropagation_tPKdPKvPK17cudnnTensorStructS8_S8_SB_S8_S8_SB_Pv version libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 with link time reference
Could not load library libcudnn_cnn_train.so.8. Error: /opt/conda/bin/../lib/./libcudnn_ops_train.so.8: symbol _Z22cudnnGenericOpTensorNdILi3EE13cudnnStatus_tP12cudnnContext16cudnnGeneric
Op_t21cudnnNanPropagation_tPKdPKvPK17cudnnTensorStructS8_S8_SB_S8_S8_SB_Pv version libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 with link time reference
Could not load library libcudnn_cnn_train.so.8. Error: /opt/conda/bin/../lib/./libcudnn_ops_train.so.8: symbol _Z22cudnnGenericOpTensorNdILi3EE13cudnnStatus_tP12cudnnContext16cudnnGeneric
Op_t21cudnnNanPropagation_tPKdPKvPK17cudnnTensorStructS8_S8_SB_S8_S8_SB_Pv version libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 with link time reference
Could not load library libcudnn_cnn_train.so.8. Error: /opt/conda/bin/../lib/./libcudnn_ops_train.so.8: symbol _Z22cudnnGenericOpTensorNdILi3EE13cudnnStatus_tP12cudnnContext16cudnnGeneric
Op_t21cudnnNanPropagation_tPKdPKvPK17cudnnTensorStructS8_S8_SB_S8_S8_SB_Pv version libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 with link time reference
Could not load library libcudnn_cnn_train.so.8. Error: /opt/conda/bin/../lib/./libcudnn_ops_train.so.8: symbol _Z22cudnnGenericOpTensorNdILi3EE13cudnnStatus_tP12cudnnContext16cudnnGeneric
Op_t21cudnnNanPropagation_tPKdPKvPK17cudnnTensorStructS8_S8_SB_S8_S8_SB_Pv version libcudnn_ops_infer.so.8 not defined in file libcudnn_ops_infer.so.8 with link time reference
Please make sure libcudnn_cnn_train.so.8 is in your library path!
Please make sure libcudnn_cnn_train.so.8 is in your library path!
Please make sure libcudnn_cnn_train.so.8 is in your library path!
Please make sure libcudnn_cnn_train.so.8 is in your library path!
Please make sure libcudnn_cnn_train.so.8 is in your library path!
Please make sure libcudnn_cnn_train.so.8 is in your library path!
Please make sure libcudnn_cnn_train.so.8 is in your library path!

  (0) UNKNOWN:  Failed to determine best cudnn convolution algorithm for:
%cudnn-conv-bw-filter = (f32[1,1,768,1664]{1,0,2,3}, u8[0]{0}) custom-call(f32[2,768,90,180]{3,2,1,0} %add.19138, f32[2,1664,90,180]{3,2,1,0} %multiply.19168), window={size=1x1}, dim_labe
ls=bf01_01io->bf01, custom_call_target="__cudnn$convBackwardFilter", metadata={op_type="Conv2DBackpropFilter" op_name="gradient_tape/model/decode/Conv2D_1/Conv2DBackpropFilter" source_fil
e="/opt/conda/lib/python3.7/site-packages/keras/optimizers/optimizer_experimental/optimizer.py" source_line=176}, backend_config="{\"conv_result_scale\":1,\"activation_mode\":\"0\",\"side
_input_scale\":0}"

Original error: INTERNAL: All algorithms tried for %cudnn-conv-bw-filter = (f32[1,1,768,1664]{1,0,2,3}, u8[0]{0}) custom-call(f32[2,768,90,180]{3,2,1,0} %add.19138, f32[2,1664,90,180]{3,2
,1,0} %multiply.19168), window={size=1x1}, dim_labels=bf01_01io->bf01, custom_call_target="__cudnn$convBackwardFilter", metadata={op_type="Conv2DBackpropFilter" op_name="gradient_tape/mod
el/decode/Conv2D_1/Conv2DBackpropFilter" source_file="/opt/conda/lib/python3.7/site-packages/keras/optimizers/optimizer_experimental/optimizer.py" source_line=176}, backend_config="{\"con
v_result_scale\":1,\"activation_mode\":\"0\",\"side_input_scale\":0}" failed. Falling back to default algorithm.  Per-algorithm errors:

To ignore this failure and try to use a fallback algorithm (which may have suboptimal performance), use XLA_FLAGS=--xla_gpu_strict_conv_algorithm_picker=false.  Please also file a bug for the root cause of failing autotuning.
         [[{{node while/replica_3/StatefulPartitionedCall}}]]
         [[while/loop_body_control/_3358/_36]]

Minimal reproducible exampel:
import tensorflow as tf

class Model(tf.keras.Model):

  def __init__(self):
    super().__init__()
    self.blocks = [
        tf.keras.layers.Conv2D(filters=32,
                               kernel_size=(3, 3),
                               strides=(1, 1),
                               padding='same',
                               data_format='channels_first',
                               name='upscale')
    ]

  def call(self, inputs):
    layer = inputs
    for b in self.blocks:
      layer = b(layer)
    return layer

def main():
  m = Model()
  x = [tf.random.uniform(shape=(32,90,180)) for _ in range(32)]
  y = [tf.random.uniform(shape=(32,90,180)) for _ in range(32)]
  ds = tf.data.Dataset.from_tensor_slices((x,y)).batch(16)
  m.compile(jit_compile=True, loss='mse')
  m.fit(ds, epochs=5)

if __name__ == '__main__':
  main()

This is on a VM created on GCP, whose details shown on login are:
======================================
Welcome to the Google Deep Learning VM
======================================

Version: tf2-gpu.2-9.m97
Based on: Debian GNU/Linux 10 (buster) (GNU/Linux 4.19.0-22-cloud-amd64 x86_64\n)

Resources:
 * Google Deep Learning Platform StackOverflow: https://stackoverflow.com/questions/tagged/google-dl-platform
 * Google Cloud Documentation: https://cloud.google.com/deep-learning-vm
 * Google Group: https://groups.google.com/forum/#!forum/google-dl-platform

To reinstall Nvidia driver (if needed) run:
sudo /opt/deeplearning/install-driver.sh
TensorFlow comes pre-installed with this image. To install TensorFlow binaries in a virtualenv (or conda env),
please use the binaries that are pre-built for this image. You can find the binaries at
/opt/deeplearning/binaries/tensorflow/
If you need to install a different version of Tensorflow manually, use the common Deep Learning image with the
right version of CUDA

Linux ultrag 4.19.0-22-cloud-amd64 #1 SMP Debian 4.19.260-1 (2022-09-29) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Oct 10 04:29:08 2022 from 135.180.175.203

Driver version from nvidia-smi:
NVIDIA-SMI 510.47.03    Driver Version: 510.47.03    CUDA Version: 11.6

This seems to not happen with tf-2.7 on the same machine, run in a docker container:
docker run --runtime=nvidia --name=gpu -it -d -w /home/doc -v /home/doc/:/home/doc/ gcr.io/deeplearning-platform-release/tf-gpu.2-7 /bin/bash

Yes, I tried that flag, unfortunately it didn't change anything :(

Ok @vivekex !
Thanks for the update. Could you look at this issue.
Thank you!

Could you try matching the. below published configuration and let us know the outcome. Thanks!
GPU

Version
Python version
Compiler
Build tools
cuDNN
CUDA

tensorflow-2.10.0
3.7-3.10
GCC 9.3.1
Bazel 5.1.1
8.1
11.2

I believe I was able to try that with a close enough setup. Getting sysdetails from TF:
import tensorflow as tf
sys_details = tf.sysconfig.get_build_info()

shows TF 2.10, python 3.7, CUDA 11.2, cudNN 8
This did let the code run successfully. I'm still unclear if this is a TF issue or a VM setup issue (I'm inclined to think it's a VM setup issue...)

It could be due to the VM setup issue, It is always suggested to use the tested and published  build configurations.
If your issue is resolved, could you please close the issue. Thanks!

I'm able to replicate a working configuration using a clean Ubuntu VM
image, and using Conda to install the nvidia deps.
The problem still arises when using out-of-the-box TF Deep Learning images
that Google Cloud provides, so I suspect even just relying on pre-built
configurations is not sufficient, there's some other incompatibility. Will
close this bug, though, since it looks like a nVidia setup issue in the VM
and not TF issue.
On Wed, Oct 12, 2022 at 4:47 PM Sachin Prasad @.***>
wrote:

It could be due to the VM setup issue, It is always suggested to use the
tested and published build configurations.
If your issue is resolved, could you please close the issue. Thanks!
—
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/58034#issuecomment-1276852167,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AY4OREKHLWEOTDSV4IGOUPLWC5EZRANCNFSM6AAAAAARA7DQ34
.
You are receiving this because you were mentioned.Message ID:
@.***>

authors: mohantym sachinprasadhs vivekex


text:
TFLite: On device Training Fails. ERROR: Node number 69 (FlexReluGrad) failed to prepare.

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu, 22.04
TensorFlow installed from (source or binary): source
TensorFlow version (or github SHA if from source): r2.12

Provide the text output from tflite_convert
I used On device training guide to convert to tflite model and then stored it as model.tflite
Then I used this c++ code to invoke the "train" signature Runner and it fails.
Standalone code to reproduce the issue

    std::unique_ptr<FlatBufferModel> model = FlatBufferModel::BuildFromFile("../model.tflite");
    tflite::ops::builtin::BuiltinOpResolver builtin_resolver;
    std::unique_ptr<Interpreter> interpreter;
    if( InterpreterBuilder(*model, builtin_resolver)(&interpreter) != kTfLiteOk){
        printf("Failed to build interpreter\n");
        exit(0);
    }

    // RESIZE Input Tensor Shape, if needed, then call ->AllocateTensors()
    if( interpreter->AllocateTensors() != kTfLiteOk){
        printf("Failed to allocate tensors!\n");
        exit(0);
    }

    //train model

    SignatureRunner* trainSignatureRunner = interpreter->GetSignatureRunner( "train" );
    trainSignatureRunner->AllocateTensors();

    TfLiteTensor* x_input_tensor = trainSignatureRunner->input_tensor( "x" );
    TfLiteTensor* y_input_tensor = trainSignatureRunner->input_tensor( "y" );

    // fill x_input_tensor
    for(int i = 0; i < 28*28; i++){
        x_input_tensor->data.f[i] = 0.5;
    }

    // fill y_input_tensor
    for(int i = 0; i < 10; i++){
        y_input_tensor->data.f[i] = 0.0;
    }
    y_input_tensor->data.f[3] = 1.0;

    int EPOCHS = 5;
    for(int epoch = 0; epoch < EPOCHS; epoch++){

        trainSignatureRunner->Invoke();

        const TfLiteTensor* loss_output = trainSignatureRunner->output_tensor( "loss" );

        printf("Epoch %d, Loss : %.4f\n", epoch, loss_output->data.f[0]);
    }

I get this output  , after compiling the file using CMakeLists.txt inside the /lite/examples/minimal/ directory and running the executable
ERROR: Select TensorFlow op(s), included in the given model, is(are) not supported by this interpreter. Make sure you apply/link the Flex delegate before inference. For the Android, it can be resolved by adding "org.tensorflow:tensorflow-lite-select-tf-ops" dependency. See instructions: https://www.tensorflow.org/lite/guide/ops_select
ERROR: Node number 69 (FlexReluGrad) failed to prepare.
Epoch 0, Loss : 0.7413
ERROR: Select TensorFlow op(s), included in the given model, is(are) not supported by this interpreter. Make sure you apply/link the Flex delegate before inference. For the Android, it can be resolved by adding "org.tensorflow:tensorflow-lite-select-tf-ops" dependency. See instructions: https://www.tensorflow.org/lite/guide/ops_select
ERROR: Node number 69 (FlexReluGrad) failed to prepare.
Epoch 1, Loss : 0.7413

..... same for all epochs

I did refer to https://www.tensorflow.org/lite/guide/ops_select and I tried building the flex delegate library using
bazel build -c opt --config=monolithic tensorflow/lite/delegates/flex:tensorflowlite_flex

This runs for a long time, and suddenly the terminal gets killed after finishing like 70%.
Can someone suggest a way to include the flex delegate library using some hacks in CMakeLists.txt or any other alterative way

Hi @Bhuvan-1
To use the select_ops we require to build the flex delegate using bazel as mentioned.
I have tried it in Mac M1 and I was successfully able to be build the flex delegate. Please find the screenshot.

Can you try this steps and see if it works for you?

@pjpratik , The issue in my pc is that, when I try to build the library it runs for some time, and the terminal gets killed suddenly, probably due to Out Of Memory killer. So problem is with my pc ig. Where can I find a pre-built library?

It gives me this error while linking
I copied the library to /usr/local/lib  and the command used to compile is
g++ example.cpp -ltensorflowlite_flex
/usr/bin/ld: skipping incompatible /usr/local/lib/libtensorflowlite_flex.so when searching for -ltensorflowlite_flex
/usr/bin/ld: cannot find -ltensorflowlite_flex: No such file or directory
/usr/bin/ld: skipping incompatible /usr/local/lib/libtensorflowlite_flex.so when searching for -ltensorflowlite_flex
collect2: error: ld returned 1 exit status
`

Hi @Bhuvan-1
We need to link the tensorflowlite_flex in CMakeLists.txt and update the path to the .so file
Sample code snippet
find_library(TF_LIB tensorflowlite HINTS "${TENSORFLOW_SOURCE_DIR}/bazel-bin/tensorflow/lite/")
find_library(TF_LIB_FLEX tensorflowlite_flex HINTS "${TENSORFLOW_SOURCE_DIR}/bazel-bin/tensorflow/lite/delegates/flex/")
target_link_libraries(testmodel
-Wl,--no-as-needed # Need --no-as-needed to link tensorflowlite_flex
${TF_LIB}
${TF_LIB_FLEX}
)

Thanks.

Hi @Bhuvan-1, it looks like you are using WSL or WSL 2. Since it seems like your .so file is in the Windows File system and not the linux one. Generally unless something specifically tells you to you should never cross file system boundaries (In this case it seems cmake is trying to read in the mounted windows directory. Can you put the .so file in /usr/lib or where ever your other .so files are? Update your CMakeLists.txt to point to location as well. It might be helpful to upload your CMakeLists.txt file as well.
Additionally please always let us know if you are using WSL/WSL 2 in the issue description as well. Thanks!

@Bhuvan-1 have you worked on model merger? i mean after on device you are saving model.ckpt. how you merging tflite model with model.ckpt for inference?

@AIML-ankit , model.ckpt  only has the weights stored. So to use them, we need to use the restore function to restore the weights from model.ckpt into memory . Then we can run inference using the updated weights.

authors: AIML-ankit Bhuvan-1 pjpratik pkgoogle


text:
TFLite GPU delegate: Broadcast output incorrect

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
Nightly at 09cf1b2a39023e617e003a51be39d419702c2d36
Custom code
Yes
OS platform and distribution
Android 12 2023-03-01
Mobile device
Vivo X80
Python version
No response
Bazel version
CMake 3.19.0
GCC/compiler version
Android NDK r25
CUDA/cuDNN version
No response
GPU model and memory
Mali-G710 MC10
Current behavior?
TFLite model file:  model.tflite.zip
The provided TFLite model contains a single broadcast operation, which when executed by the provided C++ program, should produce the following output:
1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1
2  2  2  2  2  2  2  2  2  2  2  2  2  2  2  2
3  3  3  3  3  3  3  3  3  3  3  3  3  3  3  3
4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5
6  6  6  6  6  6  6  6  6  6  6  6  6  6  6  6
7  7  7  7  7  7  7  7  7  7  7  7  7  7  7  7
8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8

However, when using the GPU delegate the following output is produced:
1  0  0  1  1  0  0  1  1  0  0  1  1  0  0  1
2  0  0  1  2  0  0  1  2  0  0  1  2  0  0  1
3  0  0  1  3  0  0  1  3  0  0  1  3  0  0  1
4  0  0  1  4  0  0  1  4  0  0  1  4  0  0  1
5  0  0  1  5  0  0  1  5  0  0  1  5  0  0  1
6  0  0  1  6  0  0  1  6  0  0  1  6  0  0  1
7  0  0  1  7  0  0  1  7  0  0  1  7  0  0  1
8  0  0  1  8  0  0  1  8  0  0  1  8  0  0  1

The correct output is produced when using the CPU and not the GPU delegate.  We are concerned that this could be a security issue if memory is being accessed incorrectly.
Content of model.tflite:
Your TFLite model has '1' subgraph(s). In the subgraph description below,
T# represents the Tensor numbers. For example, in Subgraph#0, the MUL op takes
tensor #0 and tensor #1 as input and produces tensor #2 as output.

Subgraph#0 main(T#0) -> [T#2]
  Op#0 MUL(T#0, T#1) -> [T#2]

Tensors of Subgraph#0
  T#0(serving_default_input:0) shape:[8, 1], type:FLOAT32
  T#1(BroadcastTo) shape:[8, 16], type:FLOAT32 RO 512 bytes, buffer: 2, data:[1, 1, 1, 1, 1, ...]
  T#2(PartitionedCall:0) shape:[8, 16], type:FLOAT32

---------------------------------------------------------------
Your TFLite model has '1' signature_def(s).

Signature#0 key: 'serving_default'
- Subgraph: Subgraph#0
- Inputs:
    'input' : T#0
- Outputs:
    'output' : T#2

---------------------------------------------------------------
              Model size:       1400 bytes
    Non-data buffer size:        780 bytes (55.71 %)
  Total data buffer size:        620 bytes (44.29 %)
    (Zero value buffers):          0 bytes (00.00 %)

Standalone code to reproduce the issue
#include <memory>
#include <stdio.h>

#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/delegates/gpu/delegate.h"

int main() {
    std::unique_ptr<tflite::FlatBufferModel> model =
        tflite::FlatBufferModel::BuildFromFile("model.tflite");

    tflite::ops::builtin::BuiltinOpResolver resolver;
    tflite::InterpreterBuilder builder(*model, resolver);
    std::unique_ptr<tflite::Interpreter> interpreter;
    builder(&interpreter);

    TfLiteGpuDelegateOptionsV2 options = TfLiteGpuDelegateOptionsV2Default();
    auto* delegate = TfLiteGpuDelegateV2Create(&options);
    if (interpreter->ModifyGraphWithDelegate(delegate) != kTfLiteOk) return 1;

    const TfLiteTensor *inTensor = interpreter->input_tensor(0);
    const TfLiteIntArray *inShape = inTensor->dims;
    float *input = inTensor->data.f;

    for (int i = 0; i < inShape->data[0]; i++) {
        input[i] = i + 1;
    }

    if (interpreter->Invoke() != kTfLiteOk) return 1;

    std::vector<unsigned long> outShapeVec;
    const TfLiteTensor *outTensor = interpreter->output_tensor(0);
    const TfLiteIntArray *outShape = outTensor->dims;
    const float *output = outTensor->data.f;

    const float *outPtr = output;
    for (size_t i = 0; i < outShape->data[0]; i++) {
        for (size_t j = 0; j < outShape->data[1]; j++) {
            printf("%.2g  ", *(outPtr++));
        }
        printf("\n");
    }
}

Relevant log output
No response

Hi @MichaelTylerArm
As per this comment, for broadcasting the values on GPU delegate, we need to be more explicit by restructuring the data.
Please check this similar issue #60043 and let us know if it helps.
Thanks.

Hi @pjpratik ,
I've tried swapping the inputs to MUL so that the LHS tensor is the larger one as per that issue, but I get the same result.  Both tensors have 2 dimensions, and I believe the problem is well formed (the non-broadcast dimensions are equal and the smaller tensor has size 1 along the broadcast dimension).  That issue suggests avoiding GPU broadcast altogether, although I am unclear as to what an appropriate replacement would be.  I've tried replacing the multiply by 1 with add 0, but get the same result.

Hi @sirakiin, can you please take a look? Thanks.

I've found the issue, on line 813 of tensorflow/lite/delegates/gpu/common/selectors/operation_selector.cc:
Value* output = inputs[0];  // Should be outputs[0]
If I make this change, my test case starts working.

@sirakiin
This issue should be resolved by changing that one line, would someone on the TensorFlow team be able to implement this please?

Hi @MichaelTylerArm, we are actively working on it, it will take some time to past all tests/regressions/review. Thanks for your help! In the future please feel free to submit your own PR to contribute! We will review the changes.

Hi @pkgoogle it appears to be working on master now, thanks for your help!

authors: MichaelTylerArm pjpratik pkgoogle


text:
zlib has disappeared

Obviously this isn't your doing, but http://zlib.net/zlib-1.2.8.tar.gz and http://zlib.net/zlib-1.2.9.tar.gz are no longer on that server. The new http://zlib.net/zlib-1.2.10.tar.gz released yesterday is there.
Because dependencies are downloaded as needed this is breaking the build.

Duplicate to https://github.com/tensorflow/tensorflow/issues/6594


text:
TfLiteVision can't be initialised

System information

Android Device information: samsung/o1sxeea/o1s:14/UP1A.231005.007/G991BXXSBGXED:user/release-keys
TensorFlow Lite in Play Services SDK version:

tflite_vision = { module = "org.tensorflow:tensorflow-lite-task-vision-play-services", version.ref = "0.4.4" }
tflite_gpu = { module = "com.google.android.gms:play-services-tflite-gpu", version = "16.2.0" }
tflite_java = { module = "com.google.android.gms:play-services-tflite-java", version = "16.2.0-beta02" }
tflite_support = { module = "com.google.android.gms:play-services-tflite-support", version = "16.1.0" }
tflite_metadata = { module = "org.tensorflow:tensorflow-lite-metadata", version.ref = "0.4.4" }

Google Play Services version: 24.26.32

Code to reproduce the issue
The app prints a stacktrace in the logs but doesn't crash when calling inside the activities onCreate function:
    TfLiteVision.initialize(
        context,
        TfLiteInitializationOptions.builder().setEnableGpuDelegateSupport(isGpuDelegateAvailable).build()
    )

Log that is printed:
Failed to get service from broker.
java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'.
at android.os.Parcel.createExceptionOrNull(Parcel.java:3069)
at android.os.Parcel.createException(Parcel.java:3053)
at android.os.Parcel.readException(Parcel.java:3036)
at android.os.Parcel.readException(Parcel.java:2978)
at m.hv.q(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:206)
at m.gi.run(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:54)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.os.HandlerThread.run(HandlerThread.java:67)

It further prints the following warning
Unable to update local snapshot for com.google.android.libraries.consentverifier#com.google.android.gms, may result in stale flags. (Ask Gemini)
                                                                                java.util.concurrent.ExecutionException: m.up: 17: 17: API: Phenotype.API is not available on this device. Connection failed with: dd{statusCode=DEVELOPER_ERROR, resolution=null, message=null}
                                                                                at m.aot.s(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:21)
                                                                                at m.aot.get(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:3)
                                                                                at m.aqc.g(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:11)
                                                                                at m.wh.d(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:1)
                                                                                at m.vz.run(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:5)
                                                                                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
                                                                                at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                                                                                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                                                                                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                at java.lang.Thread.run(Thread.java:1012)
                                                                                Caused by: m.up: 17: 17: API: Phenotype.API is not available on this device. Connection failed with: dd{statusCode=DEVELOPER_ERROR, resolution=null, message=null}
                                                                                at m.uq.a(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:13)
                                                                                at m.aob.f(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:3)
                                                                                at m.aod.run(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:130)
                                                                                at m.apn.execute(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:1)
                                                                                at m.aot.q(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:1)
                                                                                at m.aot.m(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:101)
                                                                                at m.aot.d(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:19)
                                                                                at m.tb.d(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:1)
                                                                                at m.ta.a(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:35)
                                                                                at m.nn.run(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:12)
                                                                                at m.apn.execute(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:1)
                                                                                at m.no.a(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:12)
                                                                                at m.ob.b(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:36)
                                                                                at m.og.j(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:20)
                                                                                at m.ni.run(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:736)
                                                                                at m.apn.execute(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:1)
                                                                                at m.nj.a(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:8)
                                                                                at m.ob.b(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:36)
                                                                                at m.oc.c(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:25)
                                                                                at m.fh.c(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:7)
                                                                                at m.gg.t(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:48)
11:12:04.781 21705-23046 MobStoreFlagStore       com.app.app.stagingserver     W  	at m.gg.f(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:10) (Ask Gemini)
                                                                                at m.gg.j(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:178)
                                                                                at m.gg.i(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:2)
                                                                                at m.gi.run(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:82)
                                                                                at android.os.Handler.handleCallback(Handler.java:958)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                at android.os.Looper.loopOnce(Looper.java:230)
                                                                                at android.os.Looper.loop(Looper.java:319)
                                                                                at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                Caused by: m.em: 17: API: Phenotype.API is not available on this device. Connection failed with: dd{statusCode=DEVELOPER_ERROR, resolution=null, message=null}
                                                                                at m.hm.a(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:13)
                                                                                at m.fh.c(:com.google.android.gms.policy_tflite_dynamite_dynamite@242327803@242327801042.644155124.644155124:3)
                                                                                ... 10 more

I am having the same issue but with the Interpreter API instead of Task Vision.
implementation 'com.google.android.gms:play-services-tflite-java:16.0.1'
implementation 'com.google.android.gms:play-services-tflite-gpu:16.1.0'
implementation 'com.google.android.gms:play-services-tflite-support:16.0.1'

TfLite.initialize(context, TfLiteInitializationOptions.builder()
  .setEnableGpuDelegateSupport(true)
  .build())

Hi, @pkgoogle
Please take look into this issue. Thank you

Hi @ThomasRichtsfeld, are you doing this in a custom app or are you following an example/documentation? For either case which of these would be closest to your use case? https://github.com/tensorflow/examples/tree/master/lite/examples, https://github.com/google-ai-edge/litert-samples/tree/main/examples. Thanks for any additional information you can provide.

@pkgoogle I am not sure if any of those fit as I was not able to find the code snippet that caused the trouble for us:
    TfLiteVision.initialize(
        context,
        TfLiteInitializationOptions.builder().setEnableGpuDelegateSupport(isGpuDelegateAvailable).build()
    )

We use it in the app of our company to do some image inference.
I am not sure if it matters how we use TfLite as the code I shared above is the one that has to be executed before using anything else from the TfLite API

So the tflite_support library is not recommended for current development: https://developers.googleblog.com/en/tensorflow-lite-is-now-litert/, since you are having an issue with it -- can you try using MediaPipe Tasks instead?

authors: ThomasRichtsfeld bxvd gaikwadrahul8 pkgoogle


text:
AttributeError: 'Sequential' object has no attribute '_get_save_spec'

1. System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
TensorFlow installation (pip package or built from source):
TensorFlow library (version, if pip package or github SHA, if built from source):

2. Code
Provide code to help us reproduce your issues using one of the following options:
Option A: Reference colab notebooks

Reference TensorFlow Model Colab: Demonstrate how to build your TF model.
Reference TensorFlow Lite Model Colab: Demonstrate how to convert your TF model to a TF Lite model (with quantization, if used) and run TFLite Inference (if possible).

(You can paste links or attach files by dragging & dropping them below)
- Provide links to your updated versions of the above two colab notebooks.
- Provide links to your TensorFlow model and (optionally) TensorFlow Lite Model.

Option B: Paste your code here or provide a link to a custom end-to-end colab
(You can paste links or attach files by dragging & dropping them below)
- Include code to invoke the TFLite Converter Python API and the errors.
- Provide links to your TensorFlow model and (optionally) TensorFlow Lite Model.

3. Failure after conversion
If the conversion is successful, but the generated model is wrong, then state what is wrong:

Model produces wrong results and/or has lesser accuracy.
Model produces correct results, but it is slower than expected.

4. (optional) RNN conversion support
If converting TF RNN to TFLite fused RNN ops, please prefix [RNN] in the title.
5. (optional) Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Hi @sakshigithubit ,
Can you give more details , like which tensorflow version and your os details?

authors: sakshigithubit sawantkumar


text:
18+VO+EXCLUSIVE VIRAL VIDEO PAKISTANI TIKTOKER IMSHA REHMAN VIRAL VIDEO ORIGINAL LINK PAKISTANI TIKTOKER VIRAL VIDEO IMSHA REHMAN VIRAL SEX VIDEO ON SOCIAL MEDIA X TRENDING NOW #81801

27 seconds ago
L𝚎aked Video Imsha Rehman Original Video Viral Video L𝚎aked on X Twitter Telegram
Who Is Imsha Rehman? Pakistani TikTok Star Deactivates Social Media Accounts After Private Video Leaks Online
Pakistani TikToker Imsha Rehman is currently facing intense trolling after her explicit videos went viral on social media. Reacting to the controversy, Imsha Rehman has deactivated her social media account.
The TikToker became the new victim of privacy breach after her explicit videos went viral, being shared widely on WhatsApp. After the controversy, Imsha Rehman has become a scapegoat for social media trolling and hate messages. Meanwhile, in interviews to local channels, Rehman has said that she was born on 7 October 2002 in Lahore.
After facing immense trolling, the social media influencer deactivated her Instagram and TikTok accounts, according to a report by Economic Times. Imsha Rehman has fallen prey to privacy breaches, and there is no information on whether she has taken any legal action in the matter. The incident raises questions about the privacy of influencers as, a few days ago, Pakistani TikToker Minahil Malik received immense hate on social media after her explicit videos went viral online.
Imsha Rehman viral video: Why Pakistani TikToker has deactivated her account? What’s there in the ‘explicit’ clip?
Pakistani TikToker Imsha Rehman has met a similar fate to that of social media influencer Minahil Malik. The Instagrammer is facing intense trolling after her explicit videos went viral on social media. Reacting to the controversy, Imsha Rehman has deactivated her social media account.
The young TikToker has become the new victim of privacy breach after her explicit videos have gone viral on social media and have been shared widely on WhatsApp. After the controversy, she has become a scapegoat for social media trolling and hate messages.
After facing immense trolling, the social media influencer deactivated her Instagram and TikTok accounts, reported Economic Times. Imsha Rehman has fallen prey to privacy breaches, and there is no information on whether she has taken any legal action in the matter. The incident raises serious questions about the privacy of social media influencers, as a few days ago, Pakistani TikTok Minahil Malik received immense hate on social media after her explicit videos went viral online.
(￢︿Short-Clip￢☆) Real Imsha Rehman Video Link Original Short Clip Imsha Rehman Viral Video X Telegram Link
Original-Imsha-Rehman-Video-Link-Original-Short-Clip-Imsha-Rehman-Viral-Video-X-Telegram-Link
Pakistani-Tiktoker-Real-Imsha-Rehman-Video-Link-Original-Short-Clip-Imsha-Rehman-Viral-Video-X-Telegram-Link
[-wATCH-]— Imsha Rehman And Kate Middleton ʟᴇᴀᴋᴇᴅ Video ᴠɪʀᴀʟ On Social Media ˣ ᵀʷⁱᵗᵗᵉʳ
[-wATCH-]— Pakistani Tiktok Imsha Rehman Video Original Video Link Pakistani Tiktok Imsha Rehman Video Viral On Social Media X Trending Now

1st

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.
2nd

.
.

.
.

.
.

.
.

.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.

.
.
.
.
.
.
.
.

.
.

.
.
cvcv

authors: dadagirisk fotiksori