text:
FailedPreconditionError: Table already initialized when use Feature Column in Eager mode

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): Latest Mac OS
TensorFlow installed from (source or binary): binary
TensorFlow version (use command below): 1.8.0
Python version: 3.6.5
Bazel version (if compiling from source): N/A
GCC/Compiler version (if compiling from source): N/A
CUDA/cuDNN version: N/A
GPU model and memory: N/A
Exact command to reproduce: see below

Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
---------------------------------------------------------------------------
FailedPreconditionError                   Traceback (most recent call last)
<ipython-input-2-443ffe416ebf> in <module>()
      7
      8 features = df.to_dict('series')
----> 9 input_layer = tf.feature_column.input_layer(features, columns)

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in input_layer(features, feature_columns, weight_collections, trainable, cols_to_vars)
    275   """
    276   return _internal_input_layer(features, feature_columns, weight_collections,
--> 277                                trainable, cols_to_vars)
    278
    279

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in _internal_input_layer(features, feature_columns, weight_collections, trainable, cols_to_vars, scope)
    200             builder,
    201             weight_collections=weight_collections,
--> 202             trainable=trainable)
    203         num_elements = column._variable_shape.num_elements()  # pylint: disable=protected-access
    204         batch_size = array_ops.shape(tensor)[0]

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in _get_dense_tensor(***failed resolving arguments***)
   3300     # Feature has been already transformed. Return the intermediate
   3301     # representation created by _transform_feature.
-> 3302     return inputs.get(self)
   3303
   3304   def _get_sequence_dense_tensor(

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in get(self, key)
   2098     column = key
   2099     logging.debug('Transforming feature_column %s.', column)
-> 2100     transformed = column._transform_feature(self)  # pylint: disable=protected-access
   2101     if transformed is None:
   2102       raise ValueError('Column {} is not supported.'.format(column.name))

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in _transform_feature(self, inputs)
   3229       ValueError: if input rank is not known at graph building time.
   3230     """
-> 3231     id_weight_pair = self.categorical_column._get_sparse_tensors(inputs)  # pylint: disable=protected-access
   3232     id_tensor = id_weight_pair.id_tensor
   3233     weight_tensor = id_weight_pair.weight_tensor

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in _get_sparse_tensors(self, inputs, weight_collections, trainable)
   2872   def _get_sparse_tensors(
   2873       self, inputs, weight_collections=None, trainable=None):
-> 2874     return _CategoricalColumn.IdWeightPair(inputs.get(self), None)
   2875
   2876

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in get(self, key)
   2098     column = key
   2099     logging.debug('Transforming feature_column %s.', column)
-> 2100     transformed = column._transform_feature(self)  # pylint: disable=protected-access
   2101     if transformed is None:
   2102       raise ValueError('Column {} is not supported.'.format(column.name))

/usr/local/lib/python3.6/site-packages/tensorflow/python/feature_column/feature_column.py in _transform_feature(self, inputs)
   2863         num_oov_buckets=self.num_oov_buckets,
   2864         dtype=key_dtype,
-> 2865         name='{}_lookup'.format(self.key)).lookup(input_tensor)
   2866
   2867   @property

/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/lookup_ops.py in index_table_from_tensor(vocabulary_list, num_oov_buckets, default_value, hasher_spec, dtype, name)
   1097           name="table_init")
   1098       table = HashTable(
-> 1099           init, default_value, shared_name=shared_name, name=hash_table_scope)
   1100     if num_oov_buckets:
   1101       table = IdTableWithHashBuckets(

/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/lookup_ops.py in __init__(self, initializer, default_value, shared_name, name)
    277           name=scope)
    278
--> 279       super(HashTable, self).__init__(table_ref, default_value, initializer)
    280
    281

/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/lookup_ops.py in __init__(self, table_ref, default_value, initializer)
    169         default_value, dtype=self._value_dtype)
    170     self._default_value.get_shape().merge_with(tensor_shape.scalar())
--> 171     self._init = initializer.initialize(self)
    172
    173   @property

/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/lookup_ops.py in initialize(self, table)
    348                             self._values)) as scope:
    349       init_op = gen_lookup_ops.initialize_table_v2(
--> 350           table.table_ref, self._keys, self._values, name=scope)
    351     ops.add_to_collection(ops.GraphKeys.TABLE_INITIALIZERS, init_op)
    352     return init_op

/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/gen_lookup_ops.py in initialize_table_v2(table_handle, keys, values, name)
    404       else:
    405         message = e.message
--> 406       _six.raise_from(_core._status_to_exception(e.code, message), None)
    407
    408

/usr/local/lib/python3.6/site-packages/six.py in raise_from(value, from_value)

FailedPreconditionError: Table already initialized. [Op:InitializeTableV2] name: input_layer/Col2_indicator/Col2_lookup/hash_table/table_init/

Source code / 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. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

import pandas as pd
import tensorflow as tf

tf.enable_eager_execution()
df = pd.DataFrame([['A1', 'A2'], ['B1', 'B2'], ['C1', 'C2']], columns=['Col1', 'Col2'])

columns = [
    tf.feature_column.indicator_column(
        tf.feature_column.categorical_column_with_vocabulary_list(col, df[col].unique())) for col in df.columns
]

features = df.to_dict('list')
input_layer = tf.feature_column.input_layer(features, columns)

Maybe @alextp has some idea on how to avoid re-initialization of lookup tables in eager mode.

Nagging Assignee @rohan100jain: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @rohan100jain: It has been 29 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

This is also the case when using multiple tf.contrib.lookup.HashTable(tf.contrib.lookup.KeyValueTensorInitializer(keys, values), -1,) calls in Eager mode, even when assigning different names in each method.

I'm working on a solution to this problem. I'd estimate a couple of weeks before it gets out.

@rohan100jain Thanks!

Nagging Assignee @rohan100jain: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @rohan100jain: It has been 29 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @rohan100jain: It has been 49 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

I see the error when using a simple
vocab_table.lookup() operation. Is there any workaround this to run it in eager mode?

@rohan100jain Any updates from your side?

Nagging Assignee @rohan100jain: It has been 30 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @rohan100jain: It has been 44 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @rohan100jain: It has been 60 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @rohan100jain: It has been 75 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Still have the same issue when I run this tutorial: https://www.tensorflow.org/alpha/tutorials/keras/feature_columns


text:
TF Record, Example, and SeqeunceExample inconsistency(?) / Documentation request

I have posted 2 stack overflow questions regarding TF Records and (Sequence)Examples.
I even had a bounty on one.
Despite only receiving up-votes. Neither received any support.
Both had an associated Colab document to assist.
The questions where

[Store images as byte strings or per channel?]https://stackoverflow.com/questions/52035692/tensorflow-v1-10-store-images-as-byte-strings-or-per-channel)

Recovering TF Records

With the corresponding colabs
Colab 1
Colab 2
I am creating an issue as I am struggling to see the consistency in the behavior between tf Records, Example, SequenceExample, Feature, Features, FeatureList, FeatureLists, FixLenFeature, FixLenSequenceFeature, and VarLenFeature.
In this Colab
I survey 10 ways of encoding an array / array of arrays.

Example: Int64 feature (int array)
Example: Float feature (float array)
Example: Bytes feature (int array dumped to byte string)
SequenceExample: Int64 feature list (array of int arrays)
SequenceExample: Float feature list (array of float arrays)
SequenceExample: Bytes feature list (array of int arrays dumped to byte strings)
Example: Bytes feature (array of int arrays all of which is dumped to byte string)
SequenceExample: Bytes feature list (array of int arrays dumped to byte strings)
SequenceExample: Bytes feature list (array of int arrays all of which is dumped to byte string)
SequenceExample: Bytes feature list (array of int arrays, where each int is dumped to byte string)

In short, with the exception of 8, I was able to 'recover' (write to tf.record and read back the data). However, it should be noted that for methods 7 and 10, the retrieved array is flattened.
Further, when I state 'recover' I mean that of course that the feature is wrapped in an addition array. e.g. shape (3, ) becomes (1, 3).
As most tutorials of TF Record, Example and SequenceExample are just a rehashing of the one example provided in the TF Docs (for a movie recommender system, although code is provided for images).
I think it would be beneficial for a "style guide" of sorts, given that one can their data in a myriad of ways. (e.g. are byte strings superior to float feature lists? should one break their image / sequence down per channel? why is there FixLenSeqeuenceFeature but no VarLenSequenceFeature?, if Example and SequenceExample are meant to contain a single data record, why are the only options List based features?)
I would be happy to contribute to more documentation / examples if I knew the answer to these questions. However, to my unexperienced eyes the mismatch between converting data into a (Sequence)Example and extracting it out from a Record is bewildering.

TensorFlow Butler requested information:
Have I written custom code: yes, see linked colabs and S.O. posts.
OS Platform and Distribution: N/a (irrelevant, but Ubuntu 16.04LTS / macOS High Sierra)
TensorFlow installed from: (irrelevant, but conda / Colab's V.M.)
TensorFlow version: 1.10
Bazel version: N/a
CUDA/cuDNN version: N/a (irrelevant but latest / Colab's V.M.'s)
GPU model and memory: N/a (irrelevant, but NVIDIA Titan X / NVIDIA Titan V / Colab's GPU)
Exact command to reproduce: see linked to code
Mobile device: N/a  (irrelevant)
This is more of a "meta" question regarding the structuring of Example / SequenceExample, the correspondingly needed Feature, Features, FeatureList, FeatureLists, etc and the parsing equivalents FixedLenFeature, VariableLenFeature, FixedLenSequenceFeature.
More specifically:

a request for more documentation

a request for "best" practices recording encoding of rank 2+ tensors

e.g. if I have a sequence in an numpy.ndarray with n channels should I "dump" (call .tostring()) on the entire sequence and store in a BytesFeature in an Example? or split each channel up into a Float/Int Feature (or dump to BytesFeature) in an Example / SequenceExample.

a request for "best" practices as to why ever use Example, when it seems that the "context features" are equivalent and then if sequence features are needed later it is easier to adapt? (i.e. the difference between context features in sequence example and normal features of example rather than just calling context features "meta-data" of the sequences)

a request for "best' practices for recording rank 0 tensors (as they have to be wrapped into a feature list, so should similarly typed features be concatenated together)

a request for elucidating why sometimes decoding a bytes array losses the rank from which it was encoded (see linked colab)

a request for a mid-tier api at the feature level e.g. remove the need for the user to define how a feature should be encoded as a record and then decoded  (parsed) from a serialized record. I have a conceptual prototype that I can include here or in another colab if interested.

etc, etc

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
Have I written custom code
OS Platform and Distribution
TensorFlow installed from
TensorFlow version
Bazel version
CUDA/cuDNN version
GPU model and memory
Exact command to reproduce
Mobile device

@tensorflowbutler O.P. updated

@poxvoculi here is a concept

Nagging Assignee @poxvoculi: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

tf.Example encoding (or more generally, proto encoding) is a thing for Servo, and for TFRecords, but we don't talk about it much in our main docs because it's sort of an advanced topic. Not sure this is the most important thing about our docs right now, but leaving it here for consideration.

@martinwicke while I understand that TFRecords are sort of an advanced topic, how to use them should be transparent as their use alone can accelerate training ~30%
Anyway, the main thing is partly dealing with the inconsistency / duplicate code needed for read/write  to TF Records.
I find it currently incredibly infuriating the number of hoops that have to be jumped through to use TFRecords with a custom estimator because certain operations can not be done inside dataset.map (at least not in the traditional mode, perhaps with eager...) e.g. unwrapping the forced requirements of lists and decoding binary strings
So I made this concept which if you clone,  run a jupyter notebook in /jupyter and open the file Demo  you can see an example that requires a single interface to write to and read from a TF Record. However to truly get the values back, one needs to wait until after sessions.run otherwise you get an error...

@martinwicke further why is int64 feature types even a thing? since most tf layer functions will through an error when seeing an integer typed tensor?

Derek or Jiri may have some ideas how we can make it easier to use TFRecords.

Nagging Assignees @lamberta, @mrry, @jsimsa, @MarkDaoust: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@martinwicke, @mrry @jsimsa  I provided a concept (see above), which involves defining a singular schema for the data. This works for both example and sequence example, because to convert to a sequence example, one must only specify what features are the sequence features.
Nonetheless, it is clear that the interface to TF Records is clunky. Consider a serving_input_receiver_fn which requires, once again, use of the tf.FixedLenFeature / tf.VarLenFeature.  All of this could be circumvented with the singular data schema object that could serve to read / write to tf records as well as parse those read records.
Then users, in addition to a config json, could have a schema json which makes it clear what the expected information is for a singular example.

Nagging Assignees @lamberta, @mrry, @jsimsa, @MarkDaoust: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@lamberta @mrry @jsimsa @MarkDaoust  I am still waiting for some assistance with this. Use of TF records, even with tf.data.TFRecordDataset(<files>) can be problematic, especially with SequenceExamples in unwrapping the forced wrapped features and feating into an input_fn for a custom estimator.
My point is that it is unclear the best way to do something simple with TF records and given how much of the "higher" level apis require knowledge of lower level apis, it is just unacceptable the lack of support.

Nagging Assignees @lamberta, @mrry, @jsimsa, @MarkDaoust: It has been 15 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@martinwicke  I know TF is in the midst of a huge transition to TF2. However, should it be of interest to anyone in the TF team I submitted a proposal for "summer of code" along the line of working with TF Records / (Sequence)Example / Features.

@SumNeuron Since, we have moved to tensorflow 2.x, the team is actively supporting 2.x not 1.x. Is this still an issue?

source: gharchive/issue

authors: SumNeuron gowthamkpr martinwicke tensorflowbutler

repo: tensorflow/tensorflow

license_type: permissive

license_source: github-api


text:
Support exporting the transform graph from tf.Transform together with the model graph defined using Keras to SavedModel in TensorFlow 2.0

System information

TensorFlow version (you are using): TensorFlow 2.0
Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state.
The feature is:  improve tf.saved.saved_model Api in Keras and support exporting the transform graph from tf.Transform and the graph from the Keras model together into a single SavedModel.
Current behavior/state about how to export transform graph and model graph together to a SavedModel?
Estimator (Work well):
From tf.transform official tutorial, at the stage of exporting model, it will call estimator.export_saved_model(exported_model_dir, serving_input_fn) to complete the model exporting work. Inside its implementation, it calls serving_input_fn to load the transform graph from SavedModel at first, and then calls estimator's model_fn to generate the model graph, combines these two graph into one graph and finally exports it into one SavedModel. Please check the code snippet.
Keras (Can not):
For TF2.0, we define a model using keras and exports it by calling tf.saved.saved_model. This SavedModel only contains the model definition including feature columns and network structure. tf.saved.saved_model api doesn't have the parameter serving_input_fn just like estimator and it lacks the flexibility to combine transform graph and model graph together for inference.
Will this change the current api? How?
Will change the Api tf.saved.save_model, add a new parameter serving_input_fn.
Who will benefit with this feature?
The users of tf.Transform and TensorFlow 2.0
Any Other info.

The same question has been asked in Tensorflow Transform Repository as well.

@brightcoder01,
Can you please let us know if this comment has resolved your issue? Thanks!


text:
Why this simple code causes RAM memory leak? tf.shuffle seems not release memory.

System information

OS Platform and Distribution Linux Ubuntu 16.04
Python: 2.7.17 / 3.7.5
Tensorflow: 1.12.0 / 1.15.0
Numpy: 1.16.5
GPU: GeForce RTX 2080 Ti
CUDA: 9.2

Describe the current behavior
CPU memory gradually increase after each epoch until the program restarts, i suspect that dataset.shuffle doesn't release the buffer memory. Tested with tf 1.15, same situation.
Code to reproduce the issue
import gc
import numpy as np
import tensorflow as tf
def datagenerator():
    for i in range(250):
        for j in range(100):
            yield 'a','b',np.random.randn(300,120)
def f(s1,s2,feat):
    return s1,s2,feat
dataset = tf.data.Dataset.from_generator(datagenerator, (tf.string,tf.string,tf.float32))
dataset = dataset.shuffle(20000)
dataset = dataset.batch(200, drop_remainder=True)
dataset = dataset.map(f)
test_iter = dataset.make_initializable_iterator()
test_next = test_iter.get_next()

run_config = tf.ConfigProto()
run_config.gpu_options.allow_growth = True
with tf.Session(config=run_config) as sess:

    for i in range(100):

        sess.run(test_iter.initializer)

        while True:
            try:
                loss_list = sess.run([test_next])
                print(len(loss_list[0]))
            except tf.errors.OutOfRangeError:
                print("train epoch %d finish" % (i+1))
                break
        gc.collect()

@kindernerd, Is this similar #34942 issue.

@kindernerd, Can you please let us know if you are happy to close if its duplicate of #34942 issue.

@kindernerd, Can you please let us know if you are happy to close if its duplicate of #34942 issue.

ok, sorry for the  duplication

authors: gadagashwini kindernerd


text:
WARNING:tensorflow:Gradients do not exist for variables

While training BERT on TPU i am getting these warnings and my precision and recall is zero while accuracy is 100
Train for 45205 steps, validate for 206 steps
WARNING:tensorflow:Gradients do not exist for variables ['tf_bert_model_1/bert/pooler/dense/kernel:0', 'tf_bert_model_1/bert/pooler/dense/bias:0'] when minimizing the loss.
WARNING:tensorflow:Gradients do not exist for variables ['tf_bert_model_1/bert/pooler/dense/kernel:0', 'tf_bert_model_1/bert/pooler/dense/bias:0'] when minimizing the loss.
WARNING:tensorflow:Gradients do not exist for variables ['tf_bert_model_1/bert/pooler/dense/kernel:0', 'tf_bert_model_1/bert/pooler/dense/bias:0'] when minimizing the loss.
WARNING:tensorflow:Gradients do not exist for variables ['tf_bert_model_1/bert/pooler/dense/kernel:0', 'tf_bert_model_1/bert/pooler/dense/bias:0'] when minimizing the loss.

Here is google colab file i am using
https://colab.research.google.com/drive/1l0Eoram6vJRK5xQBmnCx-eU1e46higlo
updated colab file
https://colab.research.google.com/drive/1D-eKgddRHROG39R2iyqE3qR7w0N0OHAB

@talhaanwarch,
I was unable to reproduce the issue as the file task_a_distant.tsv is missing. Please find the gist of it here.
Could you please share all the supporting files required to run the given code? Thanks!

@amahendrakar  please check this file, i have updated.
https://colab.research.google.com/drive/1D-eKgddRHROG39R2iyqE3qR7w0N0OHAB

@talhaanwarch,
On running the updated colab gist, I got the metrics binary_accuracy: 0.6635 - precision: 0.3663 - recall: 0.0120. Please find the gist of it here. Thanks!

but the warning is still there. WARNING:tensorflow:Gradients do not exist for variables ['tf_bert_model/bert/pooler/dense/kernel:0', 'tf_bert_model/bert/pooler/dense/bias:0'] when minimizing the loss.  I am thinking it should be an error instead of warning. becuase if gradient donot exist, how it will be updated?

@talhaanwarch Please take a look at this issue which is very similar to this issue.

@talhaanwarch Can yo please respond to the above comment so that we can take the discussion further. Thanks!

i requested at issue  if he can update his colab notebook with solution, but for me i am unable to figure out the solution

I'm getting same error. No solution found so far.

same error founded.

same error for me

@talhaanwarch Please post your issue here. Is this happening only on TPUs ? or is it happening on GPUs too?

I have a similar warning message using TF2.2 on Colab GPU:
WARNING:tensorflow:Gradients do not exist for variables ['Variable:0'] when minimizing the loss.

@gowthamkpr  i am getting this error on TPU only

@talhaanwarch The warning occurs on GPU too. Its not specific to TPU. Please find the the gist here. As mentioned in this issue comment, this is not an bug. It means that these variables are not updated during training.
If you have more questions, please post the issue here or in stackoverflow. Thanks!

I'm also getting this warning ! my embedding layers and attention layers are not updating and remains fixed as initialized. if anyone have solution please tell me.

model architecture
`# Defining all Layers...
embd=Embedding(input_dim=len(vocab),output_dim=100,name="embd")
lstm1=Bidirectional(LSTM(units=100,return_sequences=True,name="lstm1"),name="bd1")
lstm2=Bidirectional(LSTM(units=100,return_sequences=True,name="lstm2"),name="bd2")
Attention Layers to make seq-length=21
Developed by Gajesh Ladhar
attention_layer=Attention_Model(21,200)
dense1=Dense(units=80,name="dense1",kernel_regularizer="l2")
dropout1=Dropout(0.5)
act1=Activation('sigmoid')
dense2=Dense(units=50,name="dense2",kernel_regularizer="l2")
dropout2=Dropout(0.4)
act2=Activation('sigmoid')
dense3=Dense(units=30,name="dense3",kernel_regularizer="l2")
dropout3=Dropout(0.3)
act3=Activation('sigmoid')
dense4=Dense(units=len(classes),name="dense4")
dropout4=Dropout(0.2)
output=Activation('softmax')
`
Forward pass
`def forward_pass(X):
t=embd(X)
t=lstm1(t)
t=lstm2(t)
Input to Attention Layer
t=attention_layer(t)
t=dense1(t)
t=dropout1(t)
t=act1(t)
t=dense2(t)
t=dropout2(t)
t=act2(t)
t=dense3(t)
t=dropout3(t)
t=act3(t)
t=dense4(t)
t=dropout4(t)
t=output(t)
return t`
Attention model :
`class Attention_Model():
def init(self,seq_length,units):
self.seq_length=seq_length
self.units=units
self.lstm=LSTM(units=units,return_sequences=True,return_state=True)
def get_lstm_s(self,seq_no):
input_lstm=tf.expand_dims(tf.reduce_sum(self.X*(self.alphas[:,:,seq_no:seq_no+1]),axis=1),axis=1)
a,b,c=self.lstm(input_lstm)
self.output[:,seq_no,:]=a[:,0,:]
return b

def call(self,X):
self.X=X
self.output=np.zeros(shape=(self.X.shape[0],self.seq_length,self.units))
self.dense=Dense(units=self.seq_length)
self.softmax=Softmax(axis=1)
for i in range(self.seq_length+1):
  if i==0 :
    s=np.zeros(shape=(self.X.shape[0],self.units))
  else :
    s=self.get_lstm_s(i-1)
  if(i==self.seq_length):
    break

  s=RepeatVector(self.X.shape[1])(s)
  concate_X=np.concatenate([self.X,s],axis=-1)

  self.alphas=self.softmax(self.dense(concate_X))

return self.output

`
is anything wrong with implementation or something else ?

@amahendrakar
how to remove these WARNING from output Info ???

@SmileTM,
To disable the warning logs, try changing the log level using the below code.
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf

If you need further help, please submit a new issue from this link and fill in the template, so that we can track the issue there. Thanks!

https://stackoverflow.com/questions/57144586/tensorflow-gradienttape-gradients-does-not-exist-for-variables-intermittently
optimizer.apply_gradients(
    (grad, var)
    for (grad, var) in zip(gradients, model.trainable_variables)
    if grad is not None
)

For me, I just reduce the batch size to 5 and then ignored the waring

authors: FathiMahdi LunarBerial SmileTM acse-ncv19 amahendrakar gajeshladhar gowthamkpr nguyenphuhien13 saahiluppal talhaanwarch zccyman


text:
Tensorflow Java API in Scala with scala-reflect runtime compilation

System information
I am using the HelloWorld example from Java API. I am using Scala to execute it without any problems if I compile the code at "compile time. Instead with I run that using the scala-reflect and therefore runtime compilation, the Session.Runner is not found.

OS Platform and Distribution: Linux Ubuntu 18.04
JDK:

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

TensorFlow: from build.sbt

lazy val commonSettings = Seq(
    scalaVersion := "2.12.10",

    libraryDependencies ++= {
      Seq(
                  // To support runtime compilation
        "org.scala-lang" % "scala-reflect" % scalaVersion.value,
        "org.scala-lang" % "scala-compiler" % scalaVersion.value,

        // for tensorflow4java
        "org.tensorflow" % "tensorflow" % "1.15.0",
        "org.tensorflow" % "proto" % "1.15.0",
        "org.tensorflow" % "libtensorflow_jni" % "1.15.0"

      )
    }
)

lazy val `test-proj` = project
  .in(file("."))
  .settings(commonSettings)

Describe the current behavior
Basically, when compiling at runtime the Runner does not gets executed. It compiles properly, but when executing, the runner does not exists. Here is the short stacktrace.
java.lang.NoSuchMethodError: org.tensorflow.Session.runner()Lorg/tensorflow/Session$$Runner;
at __wrapper$1$f093d26a3c504d4381a37ef78b6c3d54.__wrapper$1$f093d26a3c504d4381a37ef78b6c3d54$.$anonfun$wrapper$1(:15)
Describe the expected behavior
I expect that both pre-compiled or runtime compilation code will have the same behavior.
Standalone code to reproduce the issue
Here is what WORKS:
import org.tensorflow.Graph
import org.tensorflow.Session
import org.tensorflow.Tensor
import org.tensorflow.TensorFlow

val g = new Graph()
val value = "Hello from " + TensorFlow.version()
val t = Tensor.create(value.getBytes("UTF-8"))
// The Java API doesn't yet include convenience functions for adding operations.
g.opBuilder("Const", "MyConst").setAttr("dtype", t.dataType()).setAttr("value", t).build();

val s = new Session(g)
val output = s.runner().fetch("MyConst").run().get(0)

And here, what DOES NOT work:
import scala.reflect.runtime.{universe => ru}
import scala.tools.reflect.ToolBox
val fnStr = """
    {() =>
      import org.tensorflow.Graph
      import org.tensorflow.Session
      import org.tensorflow.Tensor
      import org.tensorflow.TensorFlow

      val g = new Graph()
      val value = "Hello from " + TensorFlow.version()
      val t = Tensor.create(value.getBytes("UTF-8"))
      g.opBuilder("Const", "MyConst").setAttr("dtype", t.dataType()).setAttr("value", t).build();

      val s = new Session(g)

      s.runner().fetch("MyConst").run().get(0)
    }
    """
val mirror = ru.runtimeMirror(getClass.getClassLoader)
val tb = mirror.mkToolBox()
var t = tb.parse(fnStr)
val fn = tb.eval(t).asInstanceOf[() => Any]
// and finally, executing the function
fn()

Before, submitting this issue I posted a Question on stackoverflow: https://stackoverflow.com/questions/60783153/tensorflow-in-scala-reflection
I will try the Scala API provided by https://github.com/eaplatanios/tensorflow_scala

Did you make it work?

Hi There,
We are checking to see if you still need help on this, as you are using an older version of tensorflow which is officially considered end of life . We recommend that you upgrade to the latest 2.x version and let us know if the issue still persists in newer versions. Please open a new issue for any help you need against 2.x, and we will get you the right help.
This issue will be closed automatically 7 days from now. If you still need help with this issue, please provide us with more information.

authors: aitorhh steven-mi tensorflowbutler


text:
GatherV2Grad prints a deprecation warning

System information

Have I written custom code: Yes
OS Platform and Distribution: Ubuntu 20.04
TensorFlow installed from: binary (from pip)
TensorFlow version: 2.2.0
Python version: 3.7

Describe the current behavior
GatherV2Grad prints a deprecation warning when used. The warning is from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/array_grad.py#L644

WARNING:tensorflow:From /usr/local/lib/python3.7/site-packages/tensorflow/python/ops/array_grad.py:644: _EagerTensorBase.cpu (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.identity instead.

This issue is similar to https://github.com/tensorflow/tensorflow/issues/32049
Describe the expected behavior
No deprecation warning.
Standalone code to reproduce the issue
import tensorflow as tf

class Model(tf.keras.Model):
  def __init__(self,):
    super(Model, self).__init__()
    self.layer = tf.keras.layers.Dense(100)
  def call(self, x):
    return self.layer(x)

model = Model()
model.build((1,2))
weights = model.trainable_variables

with tf.GradientTape(persistent=True) as tape:
    output = model(tf.zeros([1,2]))

gradients = tape.jacobian(output, weights, experimental_use_pfor=False)

This code is based on https://github.com/tensorflow/tensorflow/issues/36227, which was about something else, but does also show the deprecation warning.

@bparr,
To suppress the warning, add these lines of code to your program
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf

Please check this gist for reference. Thanks!

Added a PR #39731 to remove the deprecation message.

authors: amahendrakar bparr yongtang


text:
Why is profiler dir deleted for non-chief nodes in MWMS in keras?

Hi,
Based on the keras tensorboard callback: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/callbacks.py#L2472
The profiler dir of non-chief node is set to a temp dir when MWMS is being used, which will be deleted later on:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/callbacks.py#L2227
https://github.com/tensorflow/tensorflow/blob/da15b34d11432b789527e4a3c3ad4eac5193a5f0/tensorflow/python/keras/callbacks.py#L2256
I understand checkpoints for non-chief nodes should be cleaned up, but why profiling result?
Happy to contribute a PR if this is a bug.
CC @jbaiocchi  @omalleyt12

@burgerkingeater,
Neither _log_write_dir nor log_dir is a temporary directory but they are the actual directories in which Tensorboard Events are stored.
Please let me know if I have understood your question correctly.
Thanks!

@rmothukuru thanks! But _log_write_dir is a temp dir for MWMS's non-chief node: https://github.com/tensorflow/tensorflow/blob/cda12732ca4610434937259b881965165564193d/tensorflow/python/keras/distribute/distributed_file_utils.py#L96

@burgerkingeater thanks for the question. With MWMS the workers are expected to have the same metrics with all-reduces. Is there a reason why the logging on chief alone isn't sufficient?

@rchao thanks for the reply. Trace view in the profiler is not necessarily to be the same across the nodes, right? E.g, two nodes are running with different hardware configuration

@burgerkingeater I see. Would you mind giving a try to not remove the profiling on non-chiefs (and re-build TensorFlow), and see if it matches what you're expecting?

CC myself @yisitu

@rchao yes, and I submitted a PR to fix this issue: https://github.com/tensorflow/tensorflow/pull/50068/, would you mind taking a look?

@rchao also I wonder why not just not writing summary if it's non-chief? Why is the overhead of creating the temp dir, writing summary to temp dir, and deleting the temp dir necessary?

Thanks @burgerkingeater! With MWMS, any API calls can trigger all-reduces across the workers and if we only perform that on chief, there is a chance that things will just hang (because it keeps waiting to all-reduce with other workers). Therefore in general all workers (including chief) should perform the same actions, but if it involves file writing to a centralized place, we'd need temporary locations for non-chief for later deletion.

Related PR has been merged , closing this issue. Thank you

authors: burgerkingeater rchao rmothukuru rthadur yisitu


text:
[v2.8.0]: Cross compiling libtensorflow.so for ARM64 fails

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 20.04
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: None
TensorFlow installed from (source or binary): source
TensorFlow version: v2.8.0
Python version: 3.8.8
Installed using virtualenv? pip? conda?: Building from source, cross-compiling for Raspberry Pi
Bazel version (if compiling from source): Automatically done by build script via docker container
GCC/Compiler version (if compiling from source): Automatically selected by build script via docker container
CUDA/cuDNN version: None
GPU model and memory: None

Describe the problem
I am trying to cross-compile libtensorflow.so to use on ARM64, but the build is failing at several steps. More info below
Provide the exact sequence of commands / steps that you executed before running into the problem
After downloading code and checking out v2.8.0, I ran following command:
tensorflow/tools/ci_build/ci_build.sh PI \
    tensorflow/tools/ci_build/pi/build_raspberry_pi.sh

This command fails due to python3.6 not being available in the docker container. To fix this issue, I installed python3.6 via following entries in the Dockerfile and a few other modifications as shown below. Without these modification the build would fail.
└─ $ ▶ git diff
diff --git a/tensorflow/tools/ci_build/Dockerfile.pi b/tensorflow/tools/ci_build/Dockerfile.pi
index 53589774291..8a021f3434e 100644
--- a/tensorflow/tools/ci_build/Dockerfile.pi
+++ b/tensorflow/tools/ci_build/Dockerfile.pi
@@ -2,6 +2,20 @@ FROM ubuntu:14.04

 LABEL maintainer="Jan Prach <jendap@google.com>"

+# install python 3.6
+RUN apt-get update
+RUN apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev -y
+RUN apt-get install python3-pip python3-dev -y
+RUN apt install software-properties-common -y
+RUN apt-get install wget -y
+RUN wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
+RUN tar -xvf Python-3.6.3.tgz
+WORKDIR /Python-3.6.3
+RUN ./configure --enable-optimizations
+RUN make -j8
+RUN make install
+WORKDIR /
+
 # Copy and run the install scripts.
 COPY install/*.sh /install/
 RUN /install/install_bootstrap_deb_packages.sh
diff --git a/tensorflow/tools/ci_build/install/install_auditwheel.sh b/tensorflow/tools/ci_build/install/install_auditwheel.sh
index c84bdf4e2ec..55e9f297f06 100755
--- a/tensorflow/tools/ci_build/install/install_auditwheel.sh
+++ b/tensorflow/tools/ci_build/install/install_auditwheel.sh
@@ -27,7 +27,7 @@ patchelf_location=$(which patchelf)
 if [[ -z "$patchelf_location" ]]; then
   set -e
   # Install patchelf from source (it does not come with trusty package)
-  wget https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2
+  wget --no-check-certificate https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2
   tar xfa patchelf-0.9.tar.bz2
   cd patchelf-0.9
   ./configure --prefix=/usr/local
diff --git a/tensorflow/tools/ci_build/install/install_pip_packages.sh b/tensorflow/tools/ci_build/install/install_pip_packages.sh
index 18e0bf73d3a..305a8c28760 100755
--- a/tensorflow/tools/ci_build/install/install_pip_packages.sh
+++ b/tensorflow/tools/ci_build/install/install_pip_packages.sh
@@ -17,7 +17,8 @@
 set -e

 # Get the latest version of pip so it recognize manylinux2010
-wget https://bootstrap.pypa.io/get-pip.py
+#wget https://bootstrap.pypa.io/get-pip.py
+wget https://bootstrap.pypa.io/pip/3.6/get-pip.py
 python3.6 get-pip.py
 rm -f get-pip.py

At this point the build proceeds up to a point where it starts to compile tensorflow code. However, I ran into following issues:
INFO: Repository aarch64_compiler instantiated at:
  /workspace/WORKSPACE:15:14: in <toplevel>
  /workspace/tensorflow/workspace2.bzl:888:21: in workspace
  /workspace/tensorflow/workspace2.bzl:208:20: in _tf_repositories
  /workspace/third_party/repo.bzl:128:21: in tf_http_archive
Repository rule _tf_http_archive defined at:
  /workspace/third_party/repo.bzl:81:35: in <toplevel>
ERROR: /workspace/tensorflow/core/util/BUILD:379:24: //tensorflow/core/util:version_info_gen depends on @local_config_git//:gen/spec.json in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Git Configuration Error: Traceback (most recent call last):
  File "/home/sdeoras/Downloads/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_sdeoras/eab0d61a99b6696edb3d2aff87b585e8/external/org_tensorflow/tensorflow/tools/git/gen_git_source.py", line 28, in <module>
    from builtins import bytes  # pylint: disable=redefined-builtin
ImportError: No module named builtins

ERROR: /workspace/tensorflow/core/util/BUILD:379:24: //tensorflow/core/util:version_info_gen depends on @local_config_git//:gen/head in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Git Configuration Error: Traceback (most recent call last):
  File "/home/sdeoras/Downloads/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_sdeoras/eab0d61a99b6696edb3d2aff87b585e8/external/org_tensorflow/tensorflow/tools/git/gen_git_source.py", line 28, in <module>
    from builtins import bytes  # pylint: disable=redefined-builtin
ImportError: No module named builtins

ERROR: /workspace/tensorflow/core/util/BUILD:379:24: //tensorflow/core/util:version_info_gen depends on @local_config_git//:gen/branch_ref in repository @local_config_git which failed to fetch. no such package '@local_config_git//': Git Configuration Error: Traceback (most recent call last):
  File "/home/sdeoras/Downloads/tensorflow/bazel-ci_build-cache/.cache/bazel/_bazel_sdeoras/eab0d61a99b6696edb3d2aff87b585e8/external/org_tensorflow/tensorflow/tools/git/gen_git_source.py", line 28, in <module>
    from builtins import bytes  # pylint: disable=redefined-builtin
ImportError: No module named builtins

ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis failed
INFO: Elapsed time: 74.009s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (375 packages loaded, 10502 targets configured)
FAILED: Build did NOT complete successfully (375 packages loaded, 10502 targets configured)

Any recommendations on what to do to be able to build libtensorflow.so for ARM64? Alternatively, if a pre-compiled library file exists what is a download location link? Also should I be building a previous version, if so, which one?

Hi @sdeoras ! Can you check these two threads on installing TFLite on ARM64 boards? Link 1, 2.

hi folks, i was able to build c-lib using bazel. we can close this bug if needed. thanks.

authors: mohantym sdeoras


text:
Support INT8 for tf.split and tf.one_hot

Click to expand!
Issue Type
Feature Request
Source
binary
Tensorflow Version
2.9.1
Custom Code
No
OS Platform and Distribution
Windows 10 Enterprise 20H2
Mobile device
No response
Python version
No response
Bazel version
No response
GCC/Compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current Behaviour?
Tensorflow will not work with int8 tensors when using one_hot or splitv.

Standalone code to reproduce the issue
import tensorflow as tf

int8_tensor = tf.constant([[1, 2],
                           [3, 4],
                           [5, 6]], dtype=tf.int8)
try:
    tf.one_hot(int8_tensor, 3)
except Exception as e:
    print(e)

Relevant log output
tensorflow.python.framework.errors_impl.InvalidArgumentError: Value for attr 'Tlen' of int8 is not in the list of allowed values: int32, int64
	; NodeDef: {{node SplitV}}; Op<name=SplitV; signature=value:T, size_splits:Tlen, split_dim:int32 -> output:num_split*T; attr=num_split:int,min=1; attr=T:type; attr=Tlen:type,default=DT_INT64,allowed=[DT_INT32, DT_INT64]> [Op:SplitV] name: split

tensorflow.python.framework.errors_impl.InvalidArgumentError: Value for attr 'TI' of int8 is not in the list of allowed values: uint8, int32, int64
	; NodeDef: {{node OneHot}}; Op<name=OneHot; signature=indices:TI, depth:int32, on_value:T, off_value:T -> output:T; attr=axis:int,default=-1; attr=T:type; attr=TI:type,default=DT_INT64,allowed=[DT_UINT8, DT_INT32, DT_INT64]> [Op:OneHot]

@chunduriv I was able to replicate the issue on colab, please find the gist here. Thank you!

@olipinski why do you need int8 support?
We can easily add it, but doing so increases TF's already massive binary size.  For this reason, we try to keep registrations minimal.  Will casting to one of the supported types work for you, or are you actually dealing with very large datasets that int8 is actually required?

@cantonios I wanted int8 support because I am using a dynamically generated dataset, which for decreasing memory usage uses int8. So, I think overall support for int8 would be useful for smaller/more efficient models.

Do you have a real use-case with proven benefit?  Yes, generally it can lead to smaller memory footprints.  But we need to balance any potentially benefit with the overall overhead of the TF binary package.  Our tensorflow pip size is capped, so adding more registrations for some ops here may mean we can't register other ops while staying under the cap size.

Other than the memory footprint, personally, I would not use it for anything else. A use-case that I could see is for quantised networks and embedded devices, but if the addition of int8 is unfeasible due to binary size, then feel free to close the issue!

It's not infeasible, I'm just asking if you have a real use-case where the workaround is a significant bottleneck.  If casting back-and-forth works for you and doesn't significantly slow down your model, then that is our preference.  We need to do a cost-benefit analysis to justify these additional registrations (at least in the near-term), so we need something more than a hypothetical savings.

Sorry, I meant if it is not desirable to add it for a single use case of reducing memory consumption. I guess the main reason to do that would be for any local testing of models, which is what my issue was about. I cannot run my models locally, as they are too big in memory usage.
As for casting — I'm using Ray, so all the code where I would have to cast it back and forth is not really accessible, without some major changes.
Hope this is clearer!

@olipinski Alright, I can buy that.  Do you want to submit an MR to enable them?

@cantonios I have made the pull request - #57056

authors: cantonios olipinski sushreebarsa


text:
Unit tests failed on some Intel Sapphire Rapids CPUs due to wrong reference results from numpy 1.23.5

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
2.15
Custom code
No
OS platform and distribution
No response
Mobile device
No response
Python version
3.10
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
This is not an issue with using Tensorflow but an issue of false test failure when running some unit tests (e.g. //tensorflow/python/kernel_tests/math_ops:tensordot_op_test_gpu) due to issues with numpy 1.23.5 on some Intel Sapphire Rapids CPUs, including and not limited to:
Intel(R) Xeon(R) Platinum 8480C
Intel(R) Xeon(R) Platinum 8468
I have filed an issue with numpy, which has more details on the numpy bug (https://github.com/numpy/numpy/issues/24903).
Currently, Tensorflow uses numpy 1.23.5 when running unit tests via bazel (https://github.com/ROCmSoftwarePlatform/tensorflow-upstream/blob/develop-upstream/requirements_lock_3_10.txt#L287). For some tests like //tensorflow/python/kernel_tests/math_ops:tensordot_op_test_gpu, it uses the results from numpy as reference. When running on systems with the above described Intel CPUs, the tests would falsely fail.
Standalone code to reproduce the issue
## This is modified from tensorflow/tools/ci_build/linux/gpu/run_py3_core.sh
set -e
set -x

N_JOBS=$(grep -c ^processor /proc/cpuinfo)

echo ""
echo "Bazel will use ${N_JOBS} concurrent job(s)."
echo ""

# Run configure.
export PYTHON_BIN_PATH=`which python3`
export CC_OPT_FLAGS='-mavx'

export TF_NEED_ROCM=0
export TF_NEED_CUDA=1
export TF_CUDA_COMPUTE_CAPABILITIES=9.0 ## Replace with the compute capability of your GPUs
export TF_CUDA_CLANG=0

yes "" | $PYTHON_BIN_PATH configure.py

# Run bazel test command. Double test timeouts to avoid flakes.
bazel test --config=cuda --test_tag_filters=-no_oss,-oss_excluded,-oss_serial,-no_gpu,-benchmark-test -k \
    --test_lang_filters=py --jobs=${N_JOBS} --test_timeout 300,450,1200,3600 \
    --build_tests_only --test_output=errors --local_test_jobs=8 --config=opt \
    --test_size_filters=small,medium \
    --run_under=//tensorflow/tools/ci_build/gpu_build:parallel_gpu_execute -- \
    //tensorflow/python/kernel_tests/math_ops:tensordot_op_test_gpu

Relevant log output
[ RUN      ] TensordotTest.test_test_tensordot_scalar_axes_float64_5_5_5_False
INFO:tensorflow:Running test_tensordot_scalar_axes in GRAPH mode.
I1012 05:21:54.708423 139914706186240 test_util.py:1521] Running test_tensordot_scalar_axes in GRAPH mode.
2023-10-12 05:21:54.715617: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1929] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 78659 MB memory:  -> device: 0, name: NVIDIA H100 80GB HBM3, pci bus id: 0000:5d:00.0, compute capability: 9.0
INFO:tensorflow:time(__main__.TensordotTest.test_test_tensordot_scalar_axes_float64_5_5_5_False): 5.42s
I1012 05:22:00.128815 139914706186240 test_util.py:2574] time(__main__.TensordotTest.test_test_tensordot_scalar_axes_float64_5_5_5_False): 5.42s
INFO:tensorflow:Running test_tensordot_scalar_axes in EAGER mode.
I1012 05:22:00.129978 139914706186240 test_util.py:1540] Running test_tensordot_scalar_axes in EAGER mode.
INFO:tensorflow:time(__main__.TensordotTest.test_test_tensordot_scalar_axes_float64_5_5_5_False): 5.11s
I1012 05:22:05.238928 139914706186240 test_util.py:2574] time(__main__.TensordotTest.test_test_tensordot_scalar_axes_float64_5_5_5_False): 5.11s
No pending test case: __main__.TensordotTest.test_test_tensordot_scalar_axes_float64_5_5_5_False
======================================================================
FAIL: test_test_tensordot_scalar_axes_float64_5_5_5_False (__main__.TensordotTest) [graph_mode]
TensordotTest.test_test_tensordot_scalar_axes_float64_5_5_5_False
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 1535, in decorated
    f(self, *args, **kwargs)
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 2436, in decorated
    f(self, *args, **kwargs)
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/org_tensorflow/tensorflow/python/kernel_tests/math_ops/tensordot_op_test.py", line 226, in test_tensordot_scalar_axes
    self.assertAllClose(tf_ans, np_ans, rtol=tol, atol=tol)
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 1657, in decorated
    return f(*args, **kwds)
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 3293, in assertAllClose
    self._assertAllCloseRecursive(a, b, rtol=rtol, atol=atol, msg=msg)
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 3249, in _assertAllCloseRecursive
    self._assertArrayLikeAllClose(
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/org_tensorflow/tensorflow/python/framework/test_util.py", line 3186, in _assertArrayLikeAllClose
    np.testing.assert_allclose(
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/pypi_numpy/site-packages/numpy/testing/_private/utils.py", line 1527, in assert_allclose
    assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
  File "/root/.cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/python/kernel_tests/math_ops/tensordot_op_test_gpu.runfiles/pypi_numpy/site-packages/numpy/testing/_private/utils.py", line 844, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-12, atol=1e-12
Mismatched value: a is different from b.
not close where = (array([0, 0, 0, ..., 4, 4, 4]), array([0, 0, 0, ..., 4, 4, 4]), array([0, 0, 0, ..., 4, 4, 4]), array([0, 0, 0, ..., 4, 4, 4]), array([0, 0, 0, ..., 4, 4, 4]), array([0, 0, 0, ..., 4, 4, 4]), array([2, 2, 2, ..., 2, 2, 3]), array([0, 1, 2, ..., 3, 4, 0]))
not close lhs = [ 1.62769716 -0.26834483  0.47169531 ...  0.99900873  0.74603632
 -1.2264429 ]
not close rhs = [-0.02489534  1.05437826 -1.4554834  ...  0.14947069  1.62145362
 -0.23293471]
not close dif = [1.65259251 1.32272308 1.92717871 ... 0.84953805 0.8754173  0.99350819]
not close tol = [1.02489534e-12 2.05437826e-12 2.45548340e-12 ... 1.14947069e-12
 2.62145362e-12 1.23293471e-12]
dtype = float64, shape = (5, 5, 5, 5, 5, 5, 5, 5)
Mismatched elements: 315000 / 390625 (80.6%)
Max absolute difference: 4.74676846
Max relative difference: 795311.53094219
 x: array([[[[[[[[ 9.517157e-01, -4.421175e-01, -5.290973e-01,
              -9.733468e-01, -9.410919e-02],
             [-3.183883e-01, -1.084177e+00, -6.588139e-01,...
 y: array([[[[[[[[ 9.517157e-01, -4.421175e-01, -5.290973e-01,
              -9.733468e-01, -9.410919e-02],
             [-3.183883e-01, -1.084177e+00, -6.588139e-01,...

Since the issue depends mainly on Numpy, let's wait till the Numpy issue to get resolved.

@sachinprasadhs It seems that numpy is not going to make new releases for 1.23.* (https://github.com/numpy/numpy/issues/24903#issuecomment-1779586475). Could we move to use 1.24.0 in TF so that we won't be impacted by the bug?

@wenchenvincent , Does 1.24.0 has the fix related to this issue?

@wenchenvincent , Does 1.24.0 has the fix related to this issue?

@sachinprasadhs Yes. Numpy 1.24.0 fixed this issue.

Thanks for confirming, but for TensorFlow to include Numpy 1.24.0 it has to take account of compatibility of all the dependency packages and bump the version, in the upcoming version 2.15.0 TensorFlow still uses Numpy >=1.23.5 and same with the ongoing nightly version as well.
@MichaelHudgins , Is there any plan to bump the Numpy version?

To my knowledge there was no immediate plan to bump the Numpy version.  Let me check with some others on this

@wenchenvincent,
Could you please try with the latest Tensorflow version and also in the setup.py file it was mentioned that 'numpy >= 1.26.0, < 2.2.0'
Please take a look at this setup.py file for the reference.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py#L114C15-L114C32
Thank you!

authors: MichaelHudgins sachinprasadhs tilakrayal wenchenvincent


text:
tf.keras.metrics.get return string intead of exception

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
binary
TensorFlow version
2.14.0
Custom code
No
OS platform and distribution
Windows
Mobile device
No response
Python version
3.10
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
Problem on metrics keras.metrics.get; it should raise an exception if metric doesn't exist: InvalidIdentifier
Standalone code to reproduce the issue
Problem on metrics

         import tensorflow as tf
         tf.keras.metrics.get('abc')

it returns "abc", but as per documentation it should raise an exception ValueError

Relevant log output
No response

Hi @venergiac-bh
I replicated this issue with Tf 2.14 ,2.13 and tf-nightly too. I attached a gist here for reference.
Thank you!

Hi @venergiac-bh ,
I have tested it with keras-nightly(3.0.0.dev2023110803) and it is raising intended exception. Please refer attached gist.

authors: SuryanarayanaY Venkat6871 venergiac-bh


text:
shape of state in the output of dynamic_rnn is undetermined

short code:
sequence_lengths, (sequences, labels) = bucket_by_sequence_length(
                                              input_length=sequence_length,
                                              tensors=[sequence, label],
                                              batch_size=72,
                                              bucket_boundaries=[80, 160, 240, 320, 400],
                                              dynamic_pad=True)
lstm_cell = core_rnn_cell.BasicLSTMCell(num_units=56)
lookup = tf.nn.embedding_lookup(......)
_, state = tf.nn.dynamic_rnn(
                      cell=lstm_cell,
                      inputs=lookup,
                      sequence_length=sequence_lengths,
                      dtype=tf.float32)

then state.h and state.c should be of shape [72, 56], but actually the first dim(batch_size) is undetermined in program, is it a bug?

CC @ebrevdo for comments

What is the shape of lookup?

@ebrevdo does it matter? let's say embedding matrix is of shape [vocab_size=90000, embed_size=500], so lookup will be of shape [72, unkown, 500], output should be [72, unknown, 56], state.h should be [72, 56]

can you confirm lookup is shape [72, unknown, 500]?
On Wed, Mar 22, 2017 at 7:37 PM, Jie Zhou notifications@github.com wrote:

@ebrevdo https://github.com/ebrevdo does it matter? let's say embedding
matrix is of shape [vocab_size=90000, embed_size=500], so lookup will be of
shape [72, unkown, 500], output should be [72, unknown, 56], state.h should
be [72, 56]
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/8571#issuecomment-288600264,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABtimzfXEmN2UUFq-eea9GWs9sXt3nPQks5rodsDgaJpZM4MjTwm
.

import tensorflow as tf
from tensorflow.contrib.rnn import core_rnn_cell
class Option(object):
    def __init__(self, filename, batch_size):
        self.sequences, self.labels, self.sequence_lengths = produce_input(filename=filename, batch_size=batch_size)
        self.vocab_size = 90000
        self.embedding_size = 500
        self.hidden_units = 56
        self.num_classes = 2

option = Option('train', 72)
embedding = tf.get_variable(name='embedding',
                            shape=[option.vocab_size, option.embedding_size],
                            initializer=tf.truncated_normal_initializer(stddev=0.05),
                            dtype=tf.float32)
lookup = tf.nn.embedding_lookup(embedding, option.sequences)
lstm_cell = core_rnn_cell.BasicLSTMCell(num_units=option.hidden_units, state_is_tuple=True)
output, state = tf.nn.dynamic_rnn(cell=lstm_cell,
                                  inputs=lookup,
                                  sequence_length=option.sequence_lengths,
                                  dtype=tf.float32)
output
Out[6]:
<tf.Tensor 'rnn/transpose:0' shape=(72, ?, 56) dtype=float32>
lookup
Out[7]:
<tf.Tensor 'embedding_lookup:0' shape=(72, ?, 500) dtype=float32>
state
Out[8]:
LSTMStateTuple(c=<tf.Tensor 'rnn/while/Exit_2:0' shape=(?, 56) dtype=float32>, h=<tf.Tensor 'rnn/while/Exit_3:0' shape=(?, 56) dtype=float32>)

@ebrevdo What's the status of this issue?

I think this is fixed in tf 1.2... OP can you confirm?
On Jun 16, 2017 1:40 PM, "Geoffrey Irving" notifications@github.com wrote:

@ebrevdo https://github.com/ebrevdo What's the status of this issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/8571#issuecomment-309128560,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABtim1bnJBGaW_RNRGN4k3WMBwCEKMO9ks5sEugSgaJpZM4MjTwm
.

Hi, I'm having the same problem with the shape of the state being undetermined when using a dynamic_rnn.
I'm using tensorflow version 1.2.1.
       (outputs,final_state) =(         tf.nn.bidirectional_dynamic_rnn(cell_fw=encoder_cell,                                     cell_bw=encoder_cell,                                     inputs=encoder_inputs_embedded,                                     sequence_length=encoder_inputs_length,                                     dtype=tf.float32, time_major=True)         )
Encoder_inputs_embedded is the following:
Tensor("embedding_lookup:0", shape=(8, 11, 20), dtype=float32) while final_state is the following:
(LSTMStateTuple(c=<tf.Tensor 'bidirectional_rnn/fw/fw/while/Exit_2:0' shape=(?, 20) dtype=float32>, h=<tf.Tensor 'bidirectional_rnn/fw/fw/while/Exit_3:0' shape=(?, 20) dtype=float32>), LSTMStateTuple(c=<tf.Tensor 'bidirectional_rnn/bw/bw/while/Exit_2:0' shape=(?, 20) dtype=float32>, h=<tf.Tensor 'bidirectional_rnn/bw/bw/while/Exit_3:0' shape=(?, 20) dtype=float32>))

What about in tf 1.3?
On Sep 3, 2017 1:33 PM, "Alex Fabbri" notifications@github.com wrote:

Hi, I'm having the same problem with the shape of the state being
undetermined when using a dynamic_rnn.
I'm using tensorflow version 1.2.1.
(outputs,final_state) =( tf.nn.bidirectional_dynamic_rnn(cell_fw=encoder_cell,
cell_bw=encoder_cell, inputs=encoder_inputs_embedded,
sequence_length=encoder_inputs_length, dtype=tf.float32, time_major=True)
)
Encoder_inputs_embedded is the following:
Tensor("embedding_lookup:0", shape=(8, 11, 20), dtype=float32) while
final_state is the following:
(LSTMStateTuple(c=<tf.Tensor 'bidirectional_rnn/fw/fw/while/Exit_2:0'
shape=(?, 20) dtype=float32>, h=<tf.Tensor 'bidirectional_rnn/fw/fw/while/Exit_3:0'
shape=(?, 20) dtype=float32>), LSTMStateTuple(c=<tf.Tensor
'bidirectional_rnn/bw/bw/while/Exit_2:0' shape=(?, 20) dtype=float32>,
h=<tf.Tensor 'bidirectional_rnn/bw/bw/while/Exit_3:0' shape=(?, 20)
dtype=float32>))
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/8571#issuecomment-326829438,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABtimwjPP56wsPLfP8KHXoeQh_cJ1W2dks5sew0EgaJpZM4MjTwm
.

I just tried it on tf 1.3, and it worked. Thanks :)

Great!

authors: Alex-Fabbri drpngx ebrevdo girving zakizhou


text:
module 'tensorflow' has no attribute 'summaries'

NOTE: Issues that are not bugs or feature requests will be closed. Please ask usage questions on StackOverflow.
You must complete this information or else your issue will be closed

Have I written custom code (as opposed to using a stock example script provided in TensorFlow)?:
TensorFlow installed from (source or binary)?:
TensorFlow version:
Bazel version (if compiling from source):
CUDA/cuDNN version:
GPU Model and Memory:
Exact command to reproduce:

Describe the problem clearly
Source Code / 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. Try to reproducible test-case code the bare-minimum necessary to generate the problem

There is no tensorflow.summaries module. It is tensorflow.summary: https://www.tensorflow.org/api_guides/python/summary

authors: asimshankar kelly-xuxixi


text:
Ability to Create New Device Context (GPU)

If I destroyed GPU context for any reason and tried to start new tensorflow session I got this error CUDA_ERROR_CONTEXT_IS_DESTROYED  and notebook kernel crashes. So, it will be a nice feature for python users if they can create a new context for tensorflow if one is destroyed.

How did you destroy the GPU context in the first place?

numba.cuda.close()
http://numba.pydata.org/numba-doc/0.32.0/cuda-reference/host.html?highlight=reset#numba.cuda.close

I don't think you can recover from a context close. This is not a supported scenario, so I am closing this.

I don't want to recover to a closed context, I want a new context to process tensoerflow operations. As I understand that Tensorflow uses more than one stream within the same context to accelerate data processing from host to device and vice-versa. Someone needs to set these up manually, it will be nice to be handled in one call.
Thanks anyway

I am not sure I understand. Are you talking about with tf.device?

No....I'll try to respond later in more detail.

authors: drpngx yazeedalrubyli


text:
do not use caching device at eager mode in tf.contrib.seq2seq.dynamic_decode

tf.contrib.seq2seq.dynamic_decode uses caching device, but caching device is not supported at eager execution mode.
This PR checks if eager execution mode is enabled and avoids using caching device if so.
There is another issue in tf.contrib.seq2seq.dynamic_decode with eager execution mode. tf.contrib.seq2seq.dynamic_decode cannot be run yet with this fix alone. I will report the issue when ready.

Nagging Assignee @protoget: It has been 23 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @protoget: It has been 37 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @protoget: It has been 52 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @protoget: It has been 67 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @protoget: It has been 83 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @protoget: It has been 97 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@TanUkkii007 thanks for the PR! Do you mind resolving the conflicts?

It has been 20 days with no activity and the awaiting response label was assigned. Is this PR still valid? Assigning the stalled label. Please comment to reassure me that this is still being worked on.

@yifeif Sorry for a late reply. I found this problem is already fixed at master while resolving the conflict. I will try if eager mode works for dynamic_decode.
https://github.com/tensorflow/tensorflow/blob/371a8dd2e1e18fd35f07ac230c52a471d90d3538/tensorflow/contrib/seq2seq/python/ops/decoder.py#L197-L199
My fix is not needed anymore so closing this PR.

source: gharchive/pull-request

authors: TanUkkii007 tensorflowbutler yifeif


text:
Fix paths used in script

Fix paths used in script, broke with migration from contrib

Nagging Assignee @wt-huang: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Changes are merged internally , closing this PR

authors: rthadur shortcipher3 tensorflowbutler


text:
Split convolution invocation into preparation and actual invocation

split DoConvolve into:

PrepareForConvolution
DoConvolve

split DoConvolveBackwardData into:

PrepareForConvolutionBackwardData
DoConvolveBackwardData

split DoConvolveBackwardFilter into:

PrepareForConvolutionBackwardFilter
DoConvolveBackwardFilter
PrepareForConvolutionXXX would allocate scratch memory.
DoConolveXXX would invoke actual convolution algorithms.
Implement forward convoution, backward input convolution, backward filter
convolution on CUDA path.

@timshen91 per discussion please find my PR to separate convolution invocation into 2 parts here. This PR only covers logic for CUDA path.
Implementation for ROCm shall be submitted after other PRs from @deven-amd for StreamExecutor.

@timshen91 I've addressed all the issues on CI other than 2 test targets: Windows Bazel, Windows Bazel GPU. From the logs I don't think they are relevant to this PR.

@timshen91 Just want to understand how to proceed on this PR. I applied kokoro:force-run label again and we are stuck on MacOS/Windows builds, but from the logs they have nothing to do with this PR.
BTW, we are about to submit a couple more PRs which includes more refactoring to StreamExecutor which makes larger part it shared between CUDA and ROCm paths.

@jlebar do you know how to get this patch merged? I don't seem to have the option.

@jlebar do you know how to get this patch merged? I don't seem to have the option.

Forwarded instructions offline, since they're not public.

authors: jlebar timshen91 whchung


text:
[XLA] Unimplemented inst in call fusion

If an unimplemented instruction is embedded inside a call or fusion operation then currently the system aborts having done a ConsumeValueOrDie.  This change allows the various clients of the evaluator to process a graph containing calls/fusions safely.
Applies to all XLA systems.

used a custom-call

is there a danger that the constant subexpression evaluator will eval the kRng instructions and eliminate them from the graph?

CSE doesn't evaluate instructions, it just commons them (i.e. replaces two instances of the same thing with one instance).  So the evaluator isn't used in CSE, and however it worked before it should continue working.
CSE skips side-effecting ops, and kRNG is marked as side-effecting.  As it happens @bixia1 is working on changing this and making the side-effects more explicit in the HLO graph, e.g. passing the state (i.e. the seed) explicitly between kRNG ops.

@jlebar sorry - i meant the constant subexpression removal step (which uses the evaluator) rather than the common subexpression removal.

sorry - i meant the constant subexpression removal step (which uses the evaluator) rather than the common subexpression removal.

Ah, what we call "constant folding".  hlo_constant_folding.cc explicitly skips kRNG ops.  Which I suppose is a bit of a hack, but there you go.

authors: DavidNorman jlebar


text:
Update TensorBoard callback in callbacks.py

See #29958 : Suggested improvements:

Added a TensorBoard example:

Material used and modified from TensorBoard in Notebooks and Getting started with TensorBoard.
Note the%-sign in front of the command line invocations (for Jupyter).

Replaced bullet points * with - to attempt to fix the way certain bullet points are displayed:

Previously, they were displayed in one "sentence" as this Markdown * syntax wasn't "picked up": This callback logs events for TensorBoard, including: * Metrics summary plots * Training graph visualization * Activation histograms * Sampled profiling (For reference, see r1.14 doc link and r2.0 doc link).

just checking in to see if anything else needs to be done @rchao @gbaned thanks!

@8bitmp3 Could you please address the reviewer comments. Thanks!

Can one of the admins verify this patch?

It has been 14 days with no activity and the awaiting response label was assigned. Is this PR still valid? Assigning the stalled label. Please comment to reassure me that this is still being worked on.

I'm going to go ahead and close this PR, because it seems to have stalled. If you're still interested in pursing this (and responding to my comments), please feel free to reopen!

authors: 8bitmp3 gbaned mellanox-github tensorflowbutler


text:
[S3] Fix error due to clashing names of temporary files created by the S3 file system

Previously the name of the temp file was controlled by the AWS SDK. But the SDK uses timestamp to create temporary files. We've run into cases where the temp files are created with the same name for two different files, and data gets corrupted.
Adds a static counter and a lock to generate a unique suffix for each temp file to resolve this.

Closing this, as the upgrade of AWS SDK fixes this issue. https://github.com/tensorflow/tensorflow/pull/36478


text:
Add more alternative path to find cuda library

Using docker image nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 to compile tf and I found those missing paths show in the code.

@googlebot I signed it!


text:
Fix unique shape inference

Fixes https://github.com/tensorflow/tensorflow/issues/44788. Seems that python side hasn't used V2 ops yet.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/unique_op.cc#L131
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/array_ops.py#L2007-L2011

Sorry for the delay, slipped of my radar last week. Will try to get to it shortly.

CL mostly looks good. The reason why this isn't being used in python right now is that ideally we'd like multiple axis support and for that I think we need to implement an UniqueOpV3 that supports it.

authors: WindQAQ jpienaar rohan100jain


text:
[ROCm CI Dockerfile] Fix pip debian package name

Try to Fix ROCm CI failure:
http://ml-ci.amd.com:21096/blue/organizations/jenkins/tensorflow%2Fgithub-prs-upstream-master%2FAMD-ROCm-Community-CI-Build/detail/PR-58328/2/pipeline

/cc @deven-amd

Hi @cheshire Can you please review this PR ? Thank you!

authors: bhack gbaned


text:
r2.11 cherry-pick: d8110a18d60 "lite: update androidx annotation location for opensource"

Refer to the original commit: https://github.com/tensorflow/tensorflow/commit/d8110a18d60fa88fbe918654ca6c2badb0aa7427

Hi @terryheo, It seems the changes in the file tensorflow/lite/java/BUILD require updating Copybara transform.

This is somehow too late for TF 2.11, the final release happened ~2 weeks ago.

Don't merge before starting work on a patch release!


text:
accelerate crf_log_norm

the base crf_log_norm function looks very cool, but it runs very slow.
I run the experiment on cpu
model name  : Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz

I use the configure
batch_size=128
max_seq_len=200

it runs 0.5s per batch
when I optimize the realization way
it  runs 0.25s per batch

Can one of the admins verify this patch?

I don't know why, when I sign the cla, it occurs.
A server error occurred, please try your request again.

required fields

I don't know why, I can't sign in the google cla. I think there is some mistake with the google cla server.

Check the email on your git commits matches the email you signed the CLA with.

I meet problem when sign in google cla.
it always
A server error occurred, please try your request again.
and when i try again, the error again.
I don't know who can fix it.

are you behind some sort of proxy ?

I signed it

yes, Because I am in China, I must use proxy to visit Google.
I fix it by change another net envirenment

I signed it!

authors: Mistobaan tensorflow-jenkins vrv wanguanglu


text:
Fix Python interpreter destructor bug and disable invoke exception

BUG=http://b/239225101
In the current Python interpreter, we do Py_DECREF(model_) in the body destructor of
InterpreterWrapper, which will be called first before member variables' destructors. This causes
an issue because destructing the MicroInterpreter (namely FreeSubgraphs) relies on some parts of
model_. This means that when the destructor of MicroInterpreter is called, the model may have
already been released, causing a segfault.
We can bypass this by not using a unique pointer for MicroInterpreter, and simply delete
interpreter_ before we call Py_DECREF(model_).
BUG=b/238459185
Some error codes are expected, such as cycles_until_run in the circular buffer op. The interpreter
wrapper shouldn't throw any exception in Python when invoke returns an error.

undoing my LGTM to prevent our CI machinery from merging with the current PR description.

Thanks for the quick attention. I actually did sneak in the second small change into this PR. :|

repo: tensorflow/tflite-micro

license_source: bigquery


text:
Bug: ModuleNotFoundError: No module named 'stochastic'

System information

Have I written custom code (as opposed to using example directory): No
OS Platform and Distribution: Pop OS (Ubuntu 20.04)
TensorTrade version: 0.2.0rc0
TensorFlow version: 1.13.1
Python version: 3.6.10 Miniconda

Describe the current behavior
Getting ModuleNotFoundError: No module named 'stochastic'
Describe the expected behavior
Code sample runs without errors.
Code to reproduce the issue
import random

import tensortrade.stochastic as sp

data = sp.gbm(
    base_price=100,
    base_volume=5,
    start_date="2010-01-01",
    times_to_generate=1000,
    time_frame="1H",
)

data.close.plot()

Other info / logs
Traceback (most recent call last):
  File "generate_ts.py", line 3, in <module>
    import tensortrade.stochastic as sp
  File "./lib/python3.6/site-packages/tensortrade/__init__.py", line 3, in <module>
    from . import environments
  File "./lib/python3.6/site-packages/tensortrade/environments/__init__.py", line 1, in <module>
    from .trading_environment import TradingEnvironment
  File "./lib/python3.6/site-packages/tensortrade/environments/trading_environment.py", line 25, in <module>
    import tensortrade.exchanges as exchanges
  File "./lib/python3.6/site-packages/tensortrade/exchanges/__init__.py", line 9, in <module>
    from . import simulated
  File "./lib/python3.6/site-packages/tensortrade/exchanges/simulated/__init__.py", line 3, in <module>
    from .stochastic_exchange import StochasticExchange
  File "./lib/python3.6/site-packages/tensortrade/exchanges/simulated/stochastic_exchange.py", line 18, in <module>
    from stochastic.noise import GaussianNoise
ModuleNotFoundError: No module named 'stochastic'

Also did you install stochastic?

Maybe this is the cause, I'll make another attempt when I can. Thanks

authors: huydhoang mwbrulhardt

repo: tensortrade-org/tensortrade


text:
ViT embeddings - ttnn.concat compilation error

Describe the bug
RuntimeError: TT_ASSERT @ ./tt_metal/common/bfloat8.hpp:154: fp32_vec.size() % num_float_in_tile == 0
To Reproduce
1- https://github.com/tenstorrent-metal/tt-metal/blob/mbahnas/ttnn_vit_classify/tests/ttnn/integration_tests/vit/test_ttnn_optimized_vit.py::test_vit_embeddings
2- https://github.com/tenstorrent-metal/tt-metal/blob/mbahnas/ttnn_vit_classify/tests/ttnn/integration_tests/vit/test_ttnn_optimized_vit_highres.py::test_vit_embeddings
Expected behavior
    # TODO: enable batch on embeddings and e2e
    # cls_tokens = self.cls_token.expand(batch_size, -1, -1)
    patch_embeddings = vit_patch_embeddings(config, pixel_values, parameters=parameters.patch_embeddings)
    embedding_output = ttnn.concat((parameters.cls_token, patch_embeddings), dim=1)

Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following environment information:

OS: [e.g. Ubuntu 20.04]
Version of software (eg. commit)

Additional context
Add any other context about the problem here.

I solved it by adding additional line to make the output of patch_embeddings to be TILE_LAYOUT, while I was expecting it's TILE_LAYOUT by default from the preceding linear function:
    patch_embeddings = vit_patch_embeddings(config, pixel_values, parameters=parameters.patch_embeddings)
    patch_embeddings = ttnn.to_layout(patch_embeddings, layout=ttnn.TILE_LAYOUT)
    embedding_output = ttnn.concat((cls_token, patch_embeddings), dim=1)

@arakhmati and @eyonland, it seems to be a ttnn thing in term of gaps in user expectation (see last comment). Is it a bug?

The error is triggered within cls_token tensor that is supposed to be bfp8_b, on device, and Tile_layout, while the error is at tinny/ttnn/operations/core.py:line740; where it's considered RM and fp32.

worth to mention that in the functional model (bf16), it went to the same location in core.py, but passed successfully, and generated the tensor shape of the concat inputs and output:
iiiiii ttnn.Shape([1, 1, 1[32], 768])
iiiiii ttnn.Shape([1, 1, 196[224], 768])
iiiiii ttnn.Shape([1, 1, 197[224], 768])

Sending to the top of the funnel triage point at tt-nn infra.

Yeah this is ttnn issue for sure. I will merge the fix to main by tomorrow morning

I merged the fix to main. This issue should be resolved now

I confirm, I have tested it on main. Thanks @arakhmati

authors: arakhmati jliangTT mbahnasTT

repo: tenstorrent-metal/tt-metal


text:
Show there is some implication which is only falsified in an infinite magma

I'm not sure I edited the blueprint correctly

Looks good to me.  Only minor comments:

One should add a \leanok to the proof as well as to the theorem, since you not only formalized the statements in Lean, but also provided proofs.
Technically we are supposed to enclose each separate Lean contribution in their own namespace to avoid collisions, though in this case this is unlikely since we don't expect EquationKis to show up elsewhere.  (Though we could add it as Equation #4695, I guess, since it has some interest...)

Ah, once you put the Lean implications in a namespace you have to adjust the blueprint \lean{} references accordingly.  I got caught out by this also.  I'll update CONTRIBUTING.md to warn about this.

Could you expand on this? I was unable to resolve this without adding import equational_theories.InfModel to equational_theories.lean.

Oh, right, you should do that also.

authors: Command-Master teorth


text:
Bug: Code that should be referencing input parameter ha_azure_eip_name_resource_group seems to use azure_eip_name_resource_group

When using allocate_new_eip = false and using PIPs already terraformed like this:
  allocate_new_eip                 = false # true
  eip                              = azurerm_public_ip.pip-egress-spoke-gateway.ip_address
  azure_eip_name_resource_group    = "foo:rg-name"
  ha_eip                           = azurerm_public_ip.pip-egress-spoke-gateway-hagw.ip_address
  ha_azure_eip_name_resource_group = "bar:rg-name"

terraform plan wants to deploy this (relevant snippets shown):
      + azure_eip_name_resource_group         = "foo:rg-name"  # correct
      + eip                                   = "20.67.87.14"   # correct
      + ha_azure_eip_name_resource_group      = "foo:rg-name"  # WRONG
      + ha_eip                                = "20.67.87.225"  # correct

Could you please take a look at this?
Thanks!
/ET

Patched code in master branch. Will be part of next release.

I'll patch my local code in the meantime - thanks!

Patched in 1.6.8

authors: Dennizz gitet


text:
Module should be updated to use AWS CLI to authenticate instead of aws-iam-authenticator

I have issues
I'm submitting a...

[ ] bug report
[*] feature request
[ ] support request - read the FAQ first!
[ ] kudos, thank you, warm fuzzy

What is the current behavior?
Module not able to run kubectl commands because of the following error:
aws-iam-authenticator": executable file not found in $PATH
What's the expected behavior?
Module should be updated to the newest authentication method, which is using AWS CLI instead of aws-iam-authenticator.
Are you able to fix this problem and submit a PR? Link here if you have already.
Fixed by installing aws-iam-authenticator.
Environment details

Affected module version: 6.0.2
OS: Ubuntu 16.04
Terraform version: 0.12

Any other relevant info

EKS cluster version: 1.14

You can use it if you want, details are here: https://github.com/terraform-aws-modules/terraform-aws-eks/issues/383#issuecomment-495178057
One draw back of the AWS CLI is it has a lot of dependencies as it's written in python.
If you have strong feelings either way, please add it to the discussion in https://github.com/terraform-aws-modules/terraform-aws-eks/issues/589 🙂

repo: terraform-aws-modules/terraform-aws-eks


text:
Tags for Cluster Autoscaler

I am finding that the module does not tag the ASG's it creates with k8s.io/cluster-autoscaler/enabled, should it be tagging with this label?
Was this previously added by the module to the ASG?

Correct. This was removed but it's simple to add, see an example here: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/examples/irsa/main.tf#L73-L84

Thanks, I had already added it but was not sure if I needed to or had a misconfigured implementation after upgrading.

Cool 🙂

authors: max-rocket-internet paulalex


text:
feat: Add flow_log_log_group_name_prefix as a output

Description

Adds flow_log_log_group_name_prefix as an output.
Motivation and Context

See #790
Breaking Changes
No.
How Has This Been Tested?

[X] I have updated at least one of the examples/* to demonstrate and validate my change(s)
[X] I have tested and validated these changes using one or more of the provided examples/* projects

[X] I have executed pre-commit run -a on my pull request

If you can pass variables to a module, you should be able to use that value without using module's outputs.
This change is not necessary.

I disagree, when you use a variable terraform creates an graph it's not guaranteed to map the dependencies correctly as if the said variable was an output of the resource that creates it terraform will need to wait for the apply therefore you need the depends_on argument. However, in this scenario I have followed convention.

authors: antonbabenko kderck

repo: terraform-aws-modules/terraform-aws-vpc


text:
Issue using certificate map

TL;DR
I'm having a lot of trouble using the certificate_map variable. Could you make an example of it being used?
Terraform Resources
No response
Detailed design
No response
Additional information
I've tried with use_ssl_certificates=true and use_ssl_certificates=false. If it's false, the private_key and certificate are required; these overrule any certificate map setting. If it's true, it requires ssl_certificates be nonempty. However, ssl_certificates will not accept a google_certificate_manager_certificate; the last part of the resource is the only part that's referenced, and the resource url is rewritten as a classic certificate instead of being a "Certificate Manager" certificate. So, I don't know how to actually use the certificate_map variable that's provided. In fact, I don't think I've ever seen a "Certificate Manager" certificate successfully used with the https_proxy resource.

In order to pass certificate_map, use_ssl_certificates needs to be false and ssl_certificates will be []. Module is not able to handle this scenario. Changing this issue as bug.

@lbordowitz #382 will fix the issue. I had to make changes to some parameters as old parameters were too limited and was causing certificate map issues.

authors: imrannayer lbordowitz


text:
fix: disable random_pass when default user off

Fixes #595

/gcbrun

authors: diegolnasc imrannayer


text:
Get IP Address for NLB?

Is there any way to get the IP of the NLB using this module to provision the A record?

@ahomatthew
Hello, you can create EIP manually, and then attach to NLB.
Example:
  additional_set = [
    {
      name  = "controller.service.annotations.service\\.beta\\.kubernetes\\.io/aws-load-balancer-type"
      value = "nlb"
      type  = "string"
    },
    {
      name  = "controller.service.annotations.service\\.beta\\.kubernetes\\.io/aws-load-balancer-eip-allocations"
      value = "${aws_eip.zone_a.id}\\,${aws_eip.zone_b.id}"
      type  = "string"
    }
   ]

Otherwise, you can use externalDNS to update your DNS automatically.
https://github.com/terraform-iaac/terraform-kubernetes-external-dns

authors: ahomatthew bohdantverdyi


text:
add details to undeploy stack

Description
Adds details to undeploy stack and related known issues.

Release required?

[x] No release
[ ] Patch release (x.x.X)
[ ] Minor release (x.X.x)
[ ] Major release (X.x.x)

Release notes content

Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
/run pipeline

Checklist for reviewers

[ ] If relevant, a test for the change is included or updated with this PR.
[ ] If relevant, documentation for the change is included or updated with this PR.

For mergers

Use a conventional commit message to set the release level. Follow the guidelines.
Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
Use the Squash and merge option.

/run pipeline

/run pipeline

/run pipeline

/run pipeline

@SirSpidey - I merged for now to have the doc public, but would value your review/inputs on the readme.

@vburckhardt FYI: I started a draft PR for the readme. I want to talk to some other writers -- I think there might be existing docs we can point to for some of this.

:tada: This PR is included in version 1.1.0 :tada:
The release is available on:

GitHub release
v1.1.0

Your semantic-release bot :package::rocket:

authors: SirSpidey maheshwarishikha terraform-ibm-modules-ops vburckhardt


text:
chore(deps): update common-dev-assets digest to fc94bf1

This PR contains the following updates:

Package
Update
Change

common-dev-assets
digest
a426d22 -> fc94bf1

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

/run pipeline

:tada: This PR is included in version 1.0.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


text:
feat: add variable and option to not manage all addons

Description
Added new input variable manage_all_addons (bool) and use value in the call to ibm_container_addons resource block. Default is false which tells Terraform to not manage addons that were not specifically installed using this module. If set to 'true' then addons installed outside this module may be destroyed on next apply.
Release required?

[ ] No release
[ ] Patch release (x.x.X)
[x] Minor release (x.X.x)
[ ] Major release (X.x.x)

Release notes content
New input variable manage_all_addons (bool) has been added.
Default is false which tells Terraform to not manage addons that were not specifically installed using this module. If set to 'true' then addons installed outside this module may be destroyed on next apply.
Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
/run pipeline

Checklist for reviewers

[ ] If relevant, a test for the change is included or updated with this PR.
[ ] If relevant, documentation for the change is included or updated with this PR.

For mergers

Use a conventional commit message to set the release level. Follow the guidelines.
Include information that users need to know about the PR in the commit message. The commit message becomes part of the GitHub release notes.
Use the Squash and merge option.

/run pipeline

/run pipeline

Upgrade test has failed, which I expected. There is only one consistency issue with the upgrade:
Resource(s) identified to be updated
Name: addons
Address: module.ocp_base.ibm_container_addons.addons
Actions: [update]
DIFF:
  Before:
 {"manage_all_addons":true}
  After:
 {"manage_all_addons":false}

Since this was the only thing reported during upgrade, and it was expected, and it is just an update, I would recommend that we can skip the upgrade test on this PR.

/run pipeline

:tada: This PR is included in version 3.11.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


text:
chore(deps): update ci dependencies

This PR contains the following updates:

Package
Type
Update
Change

common-dev-assets

digest
703433e -> 3d32bfa

github.com/gruntwork-io/terratest
require
patch
v0.46.6 -> v0.46.7

github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper
require
minor
v1.23.16 -> v1.24.0

Release Notes

gruntwork-io/terratest (github.com/gruntwork-io/terratest)
v0.46.7
Compare Source
Modules affected

http-helper

Description

Added handling for nil body in http-helper.

Special thanks

Special thanks to the following users for their contribution!

@semihbkgr

Related links

https://github.com/gruntwork-io/terratest/pull/1370

terraform-ibm-modules/ibmcloud-terratest-wrapper (github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper)
v1.24.0
Compare Source
Features

add containers for getting iks config (#698) (c8cdb82)

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

/run pipeline

/run pipeline

/run pipeline

:tada: This PR is included in version 1.6.2 :tada:
The release is available on:

GitHub release
v1.6.2

Your semantic-release bot :package::rocket:


text:
chore(deps): update terraform terraform-ibm-modules/kms-all-inclusive/ibm to v4.15.11

This PR contains the following updates:

Package
Type
Update
Change

terraform-ibm-modules/kms-all-inclusive/ibm (source)
module
patch
4.15.10 -> 4.15.11

Release Notes

terraform-ibm-modules/terraform-ibm-kms-all-inclusive (terraform-ibm-modules/kms-all-inclusive/ibm)
v4.15.11
Compare Source
Bug Fixes

deps: update terraform terraform-ibm-modules/cbr/ibm to v1.24.1 (#542) (932e3bd)

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

/run pipeline

:tada: This PR is included in version 1.8.10 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


text:
fix: remove null optional elements before jsonencode is called

Description
jsonencode sets null for any optional value that is not set. postgresql API doesn't like that. We need to remove null versions.
Release required?

[ ] No release
[ ] Patch release (x.x.X)
[ ] Minor release (x.X.x)
[ ] Major release (X.x.x)

Release notes content

Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
/run pipeline

Checklist for reviewers

[ ] If relevant, a test for the change is included or updated with this PR.
[ ] If relevant, documentation for the change is included or updated with this PR.

Merge actions for mergers

When merging, use a relevant conventional commit message that is based on the PR contents and any release notes provided by the PR author. The commit message determines whether a new version of the module is needed, and if so, which semver increment to use (major, minor, or patch).
Merge by using "Squash and merge".

/run pipeline

@akocbek Is there any kind of test we could add that would of caught this?

@ocofaigh we could set configuration object within existing test (maybe basic?) which only has one attribute (maybe max_connetions). deployment shouldn't fail with that fix.

how about adding it complete example (since it will run in PR)?

/run pipeline

/run pipeline

/run pipeline

/run pipeline

/run pipeline

:tada: This PR is included in version 3.6.4 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


text:
chore(deps): update module github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper to v1.34.1

This PR contains the following updates:

Package
Type
Update
Change

github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper
require
minor
v1.33.2 -> v1.34.1

Release Notes

terraform-ibm-modules/ibmcloud-terratest-wrapper (github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper)
v1.34.1
Compare Source
Bug Fixes

Fixed bug where Projects deploy fail reason was not being output (#819) (ede430e)

v1.34.0
Compare Source
Features

Projects parallel deploy and cleanup (#818) (cc9aa18)

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

/run pipeline


text:
chore(deps): update module github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper to v1.5.5

This PR contains the following updates:

Package
Type
Update
Change

github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper
require
patch
v1.5.4 -> v1.5.5

Release Notes

terraform-ibm-modules/ibmcloud-terratest-wrapper
v1.5.5
Compare Source
Bug Fixes

deps: update module github.com/ibm/go-sdk-core/v5 to v5.12.2 (#410) (36542ab)

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

:tada: This PR is included in version 4.0.0 :tada:
The release is available on:

GitHub release
v4.0.0

Your semantic-release bot :package::rocket: