text:
tf.contrib Module not found in tensorflow. Training and graph export not possible.

Since tuesday  around 9 AM CEST I was not able to proceed training from checkpoint or even export current checkpoint via export_inference_graph.py. Tested on both TF 1.15 and 2.1.0 and it worked flawlessly up until yesterday. Is there any workaround currently?
System information
Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes.
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux ( Google Colab)
Mobile device (e.g., Pixel 4, Samsung Galaxy 10) if the issue happens on mobile device:
TensorFlow installed from (source or binary):
TensorFlow version (use command below): 1.15 and 2.1.0
Python version: 3.6.9
Bazel version (if compiling from source):
GCC/Compiler version (if compiling from source):
CUDA/cuDNN version:
GPU model and memory: depends on which one Colab assigns to me
Please provide the entire URL of the model you are using?
https://github.com/tensorflow/models/blob/master/research/object_detection/samples/configs/faster_rcnn_inception_v2_pets.config
Describe the current behavior
Using /usr/local/lib/python3.6/dist-packages
Finished processing dependencies for object-detection==0.1
env: PYTHONPATH=/content/models/research:/content/models/research/slim
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 23, in
from object_detection.builders import model_builder
File "/content/models/research/object_detection/builders/model_builder.py", line 22, in
from object_detection.builders import box_predictor_builder
File "/content/models/research/object_detection/builders/box_predictor_builder.py", line 20, in
from object_detection.predictors import convolutional_box_predictor
File "/content/models/research/object_detection/predictors/convolutional_box_predictor.py", line 23, in
slim = tf.contrib.slim
AttributeError: module 'tensorflow' has no attribute 'contrib'
same with train.py:
Traceback (most recent call last):
File "object_detection/legacy/train.py", line 48, in
from tensorflow.contrib import framework as contrib_framework
ModuleNotFoundError: No module named 'tensorflow.contrib'
and model_main.py:
Traceback (most recent call last):
File "object_detection/model_main.py", line 26, in
from object_detection import model_lib
File "/content/models/research/object_detection/model_lib.py", line 27, in
from object_detection import eval_util
File "/content/models/research/object_detection/eval_util.py", line 40, in
slim = tf.contrib.slim
AttributeError: module 'tensorflow' has no attribute 'contrib'
and even export_inference_graph.py:
Traceback (most recent call last):
File "object_detection/export_inference_graph.py", line 108, in
from object_detection import exporter
File "/content/models/research/object_detection/exporter.py", line 20, in
from tensorflow.contrib.quantize.python import graph_matcher
ModuleNotFoundError: No module named 'tensorflow.contrib'
Describe the expected behavior
test the model builder:
object_detection/builders/model_builder_test.py outputs 17 in TF1(10 in TF2) successful tests
Code to reproduce the issue
!python object_detection/builders/model_builder_test.py
or just run this notebook in Colab:
https://colab.research.google.com/drive/1F4ggfg9_xnCcGSBKb5-ovYi_DQFZp-uV
** UPD: 1.14 version works partly. Training fails after the first evaluation due to typeerror in numpy with float64 to int conversion.

Every time you open a new terminal you need to add this into your command line export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim

every time you open a new terminal on a new start you need to add export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim to your terminal . If you need more help refer to
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

@maxkaustav
I did the following:
set the environment variable to research
%set_env PYTHONPATH=/content/models/research:/content/models/research/slim
but it doesn't solve the issue. The module tf.contrib is still missing.

@synergy178
please refer to this issue and this comment as per error faced by you and let us know.
#30794  #35197 #36878 #31350 #

@Saduf2019 thanks for your reply. As far as I understood TF 2.0+ doesn't have tf.contrib and  TF 1.15 will be supported for the next 3 years. But afterwards there won't be any updates.
But like I already wrote in the description: the module is missing in TF 1.15. That's the main problem. Otherwise this issue wouldn't even bother me for the next 3 years.
Finished processing dependencies for object-detection==0.1 env: PYTHONPATH=/content/models/research:/content/models/research/slim Traceback (most recent call last):   File "object_detection/builders/model_builder_test.py", line 23, in <module>     from object_detection.builders import model_builder   File "/content/models/research/object_detection/builders/model_builder.py", line 22, in <module>     from object_detection.builders import box_predictor_builder   File "/content/models/research/object_detection/builders/box_predictor_builder.py", line 20, in <module>     from object_detection.predictors import convolutional_box_predictor   File "/content/models/research/object_detection/predictors/convolutional_box_predictor.py", line 23, in <module>     slim = tf.contrib.slim AttributeError: module 'tensorflow' has no attribute 'contrib'

@synergy178
please refer to these comment  as per which 1.14 works fine

@synergy178
can you please use 1.14 or below versions and update us

With TF 1.14.0 there come a lot of deprecation warnings, but somehow it starts to train.
Model_main.py trains until saving the checkpoint and during the evaluation causes a type error
object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
I guess it's referring to this [issue] (https://github.com/numpy/numpy/issues/15345).
console output:
`
I0323 13:08:24.638170 139901407041408 session_manager.py:502] Done running local_init_op.
INFO:tensorflow:Performing evaluation on 10 images.
I0323 13:08:40.283396 139898070918912 coco_evaluation.py:205] Performing evaluation on 10 images.
creating index...
index created!
INFO:tensorflow:Loading and preparing annotation results...
I0323 13:08:40.284336 139898070918912 coco_tools.py:115] Loading and preparing annotation results...
INFO:tensorflow:DONE (t=0.00s)
I0323 13:08:40.286311 139898070918912 coco_tools.py:137] DONE (t=0.00s)
creating index...
index created!
2020-03-23 13:08:40.302812: W tensorflow/core/framework/op_kernel.cc:1490] Invalid argument: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 117, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 209, in call
ret = func(*args)
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func
self._metrics = self.evaluate()
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 215, in evaluate
coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)
File "/content/models/research/object_detection/metrics/coco_tools.py", line 176, in init
iouType=iou_type)
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 76, in init
self.params = Params(iouType=iouType) # parameters
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 527, in init
self.setDetParams()
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 507, in setDetParams
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
File "<array_function internals>", line 6, in linspace
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1356, in _do_call
return fn(*args)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: End of sequence
[[{{node IteratorGetNext}}]]
(1) Out of range: End of sequence
[[{{node IteratorGetNext}}]]
[[IteratorGetNext/_2033]]
0 successful operations.
0 derived errors ignored.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/evaluation.py", line 272, in _evaluate_once
session.run(eval_ops, feed_dict)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 754, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1252, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1353, in run
raise six.reraise(*original_exc_info)
File "/usr/local/lib/python3.6/dist-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1338, in run
return self._sess.run(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1411, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1169, in run
return self._sess.run(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 950, in run
run_metadata_ptr)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1350, in _do_run
run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
(0) Out of range: End of sequence
[[node IteratorGetNext (defined at object_detection/model_main.py:105) ]]
(1) Out of range: End of sequence
[[node IteratorGetNext (defined at object_detection/model_main.py:105) ]]
[[IteratorGetNext/_2033]]
0 successful operations.
0 derived errors ignored.
Original stack trace for 'IteratorGetNext':
File "object_detection/model_main.py", line 109, in
tf.app.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "object_detection/model_main.py", line 105, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate
return executor.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
return self.run_local()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local
saving_listeners=saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1192, in _train_model_default
saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1484, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 754, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1252, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1338, in run
return self._sess.run(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1419, in run
run_metadata=run_metadata))
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/basic_session_run_hooks.py", line 594, in after_run
if self._save(run_context.session, global_step):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/basic_session_run_hooks.py", line 619, in _save
if l.after_save(session, step):
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 519, in after_save
self._evaluate(global_step_value)  # updates self.eval_result
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 539, in _evaluate
self._evaluator.evaluate_and_export())
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 920, in evaluate_and_export
hooks=self._eval_spec.hooks)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 477, in evaluate
name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 519, in _actual_eval
return _evaluate()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 501, in _evaluate
self._evaluate_build_graph(input_fn, hooks, checkpoint_path))
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1501, in _evaluate_build_graph
self._call_model_fn_eval(input_fn, self.config))
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1534, in _call_model_fn_eval
input_fn, ModeKeys.EVAL)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1022, in _get_features_and_labels_from_input_fn
self._call_input_fn(input_fn, mode))
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/util.py", line 65, in parse_input_fn_result
result = iterator.get_next()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 426, in get_next
output_shapes=self._structure._flat_shapes, name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_dataset_ops.py", line 1947, in iterator_get_next
output_shapes=output_shapes, name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 2005, in init
self._traceback = tf_stack.extract_stack()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1356, in _do_call
return fn(*args)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 117, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 209, in call
ret = func(*args)
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func
self._metrics = self.evaluate()
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 215, in evaluate
coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)
File "/content/models/research/object_detection/metrics/coco_tools.py", line 176, in init
iouType=iou_type)
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 76, in init
self.params = Params(iouType=iouType) # parameters
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 527, in init
self.setDetParams()
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 507, in setDetParams
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
File "<array_function internals>", line 6, in linspace
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
 [[{{node PyFunc_3}}]]
 [[cond_5/Detections_Left_Groundtruth_Right/5/_2891]]

(1) Invalid argument: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 117, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 209, in call
ret = func(*args)
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func
self._metrics = self.evaluate()
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 215, in evaluate
coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)
File "/content/models/research/object_detection/metrics/coco_tools.py", line 176, in init
iouType=iou_type)
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 76, in init
self.params = Params(iouType=iouType) # parameters
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 527, in init
self.setDetParams()
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 507, in setDetParams
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
File "<array_function internals>", line 6, in linspace
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
 [[{{node PyFunc_3}}]]

0 successful operations.
0 derived errors ignored.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "object_detection/model_main.py", line 109, in
tf.app.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "object_detection/model_main.py", line 105, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate
return executor.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
return self.run_local()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local
saving_listeners=saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1192, in _train_model_default
saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1484, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 754, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1252, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1353, in run
raise six.reraise(*original_exc_info)
File "/usr/local/lib/python3.6/dist-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1338, in run
return self._sess.run(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1419, in run
run_metadata=run_metadata))
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/basic_session_run_hooks.py", line 594, in after_run
if self._save(run_context.session, global_step):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/basic_session_run_hooks.py", line 619, in _save
if l.after_save(session, step):
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 519, in after_save
self._evaluate(global_step_value)  # updates self.eval_result
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 539, in _evaluate
self._evaluator.evaluate_and_export())
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 920, in evaluate_and_export
hooks=self._eval_spec.hooks)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 477, in evaluate
name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 519, in _actual_eval
return _evaluate()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 508, in _evaluate
output_dir=self.eval_dir(name))
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1609, in _evaluate_run
config=self._session_config)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/evaluation.py", line 272, in _evaluate_once
session.run(eval_ops, feed_dict)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 854, in exit
self._close_internal(exception_type)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 887, in _close_internal
h.end(self._coordinated_creator.tf_sess)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/basic_session_run_hooks.py", line 951, in end
self._final_ops, feed_dict=self._final_ops_feed_dict)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 950, in run
run_metadata_ptr)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1350, in _do_run
run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 117, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 209, in call
ret = func(*args)
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func
self._metrics = self.evaluate()
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 215, in evaluate
coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)
File "/content/models/research/object_detection/metrics/coco_tools.py", line 176, in init
iouType=iou_type)
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 76, in init
self.params = Params(iouType=iouType) # parameters
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 527, in init
self.setDetParams()
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 507, in setDetParams
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
File "<array_function internals>", line 6, in linspace
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
 [[node PyFunc_3 (defined at /content/models/research/object_detection/metrics/coco_evaluation.py:394) ]]
 [[cond_5/Detections_Left_Groundtruth_Right/5/_2891]]

(1) Invalid argument: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 117, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 209, in call
ret = func(*args)
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func
self._metrics = self.evaluate()
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 215, in evaluate
coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)
File "/content/models/research/object_detection/metrics/coco_tools.py", line 176, in init
iouType=iou_type)
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 76, in init
self.params = Params(iouType=iouType) # parameters
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 527, in init
self.setDetParams()
File "/usr/local/lib/python3.6/dist-packages/pycocotools/cocoeval.py", line 507, in setDetParams
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
File "<array_function internals>", line 6, in linspace
File "/usr/local/lib/python3.6/dist-packages/numpy/core/function_base.py", line 121, in linspace
.format(type(num)))
TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.
 [[node PyFunc_3 (defined at /content/models/research/object_detection/metrics/coco_evaluation.py:394) ]]

0 successful operations.
0 derived errors ignored.
Original stack trace for 'PyFunc_3':
File "object_detection/model_main.py", line 109, in
tf.app.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/usr/local/lib/python3.6/dist-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "object_detection/model_main.py", line 105, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate
return executor.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
return self.run_local()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local
saving_listeners=saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1192, in _train_model_default
saving_listeners)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1484, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 754, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1252, in run
run_metadata=run_metadata)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1338, in run
return self._sess.run(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/monitored_session.py", line 1419, in run
run_metadata=run_metadata))
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/basic_session_run_hooks.py", line 594, in after_run
if self._save(run_context.session, global_step):
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/basic_session_run_hooks.py", line 619, in _save
if l.after_save(session, step):
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 519, in after_save
self._evaluate(global_step_value)  # updates self.eval_result
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 539, in _evaluate
self._evaluator.evaluate_and_export())
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/training.py", line 920, in evaluate_and_export
hooks=self._eval_spec.hooks)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 477, in evaluate
name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 519, in _actual_eval
return _evaluate()
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 501, in _evaluate
self._evaluate_build_graph(input_fn, hooks, checkpoint_path))
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1501, in _evaluate_build_graph
self._call_model_fn_eval(input_fn, self.config))
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1537, in _call_model_fn_eval
features, labels, ModeKeys.EVAL, config)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1146, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/content/models/research/object_detection/model_lib.py", line 482, in model_fn
eval_config, list(category_index.values()), eval_dict)
File "/content/models/research/object_detection/eval_util.py", line 947, in get_eval_metric_ops_for_evaluators
eval_dict))
File "/content/models/research/object_detection/metrics/coco_evaluation.py", line 394, in get_estimator_eval_metric_ops
first_value_op = tf.py_func(first_value_func, [], tf.float32)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 480, in py_func
return py_func_common(func, inp, Tout, stateful, name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 462, in py_func_common
func=func, inp=inp, Tout=Tout, stateful=stateful, eager=False, name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/script_ops.py", line 285, in _internal_py_func
input=inp, token=token, Tout=Tout, name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_script_ops.py", line 159, in py_func
"PyFunc", input=input, token=token, Tout=Tout, name=name)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py", line 2005, in init
self._traceback = tf_stack.extract_stack()`

@synergy178
please provide with simple standalone code for us to replicate the issue faced on our local

https://colab.research.google.com/drive/1F4ggfg9_xnCcGSBKb5-ovYi_DQFZp-uV
I hope this notebook can help

I'm facing the same issue with TF 2.1.0

https://colab.research.google.com/drive/1F4ggfg9_xnCcGSBKb5-ovYi_DQFZp-uV
I hope this notebook can help

Tried executing the steps given in this comment. But, facing the same issue.

Using /usr/local/lib/python3.6/dist-packages
Finished processing dependencies for object-detection==0.1
env: PYTHONPATH=/content/models/research:/content/models/research/slim
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 23, in
from object_detection.builders import model_builder
File "/content/models/research/object_detection/builders/model_builder.py", line 22, in
from object_detection.builders import box_predictor_builder
File "/content/models/research/object_detection/builders/box_predictor_builder.py", line 20, in
from object_detection.predictors import convolutional_box_predictor
File "/content/models/research/object_detection/predictors/convolutional_box_predictor.py", line 23, in
slim = tf.contrib.slim
AttributeError: module 'tensorflow' has no attribute 'contrib'

@synergy178
I ran the gist shared by you on 1.14 and do not face any tf.contrib error as faced by you on the second cell on your gist, please ensure to use 1.14 or lower versions and share all dependencies in case you still face any issues. please find the gist of the same here

@synergy178
the error faced is not with tf.contrib please create this issue on stackoverflow.
please confirm if we may move this to closed status
This question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there.

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

I have also faced similar errors with colab and tensorflow 1.15.2
I have solved the problem by manually installing tensorflow 1.15.3 using
!pip install tensorflow-gpu==1.15.3


text:
/usr/bin/env: 'python': No such file or directory

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.04
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: NA
TensorFlow installed from (source or binary): Built from Github source
TensorFlow version: Latest (2.2)
Python version: 3.8
Installed using virtualenv? pip? conda?: No virtual or conda used
Bazel version (if compiling from source): 3.4.1
GCC/Compiler version (if compiling from source): NA
CUDA/cuDNN version: NA
GPU model and memory: NA

Issue "Tensorflow does not build in a python3 only environment #15618" is still a problem.
Rather than have to trawl through google posts and forums to find a solution it would be preferable if the build instructions mentioned the simple work-around of creating a Sym link to Python3 using the following
sudo link /usr/bin/python3 /usr/bin/python

@leematthewshome
Please provide with all details/steps followed before the issue was faced, including the error log for us to analyse.

This is a bazel issue, not TF

source: gharchive/issue

authors: Saduf2019 leematthewshome mihaimaruseac

repo: tensorflow/tensorflow

license_type: permissive

license_source: github-api


text:
Deprecate non-tuple nd-indices

This is deprecated in NumPy (numpy/numpy#9686) and in Jax already removed (google/jax#4867) but TensorFlow still uses this feature as can be seen by using NumPy arrays and Jax arrays:
>>> from tensorflow.keras import Sequential
>>> from jax.numpy import array
>>> Sequential().predict(array([0]))
[...]
TypeError: Using a non-tuple sequence for multidimensional indexing is not allowed; use `arr[array(seq)]` instead of `arr[seq]`. See https://github.com/google/jax/issues/4564 for more information.
[...]
>>> from numpy import array
>>> Sequential().predict(array([0]))
array([0])

For now, I opened an issue on Jax (google/jax#8980) and asked to revert this change, but anyway I think TensorFlow really should accept the deprecation.

https://github.com/google/jax/issues/8980#issuecomment-996026127


text:
An error in the official pruning  guide

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.15
Custom code
No
OS platform and distribution
Google Colab
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 behavior?
I followed this official pruning guide: https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras

I opened code in google colab (https://colab.research.google.com/github/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/pruning/pruning_with_keras.ipynb) and ran all cells..

And there is an ValueError: `prune_low_magnitude` can only prune an object of the following types: keras.models.Sequential, keras functional model, keras.layers.Layer, list of keras.layers.Layer. You passed an object of type: Sequential. in line model_for_pruning = prune_low_magnitude(model, **pruning_params)

I tried this code on my local machine and it gives the same error.
This looks like an bug.
Standalone code to reproduce the issue
Code from offical guide: https://colab.research.google.com/github/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/pruning/pruning_with_keras.ipynb

Relevant log output
No response

import tensorflow as tf
import tempfile
from tensorflow import keras
Load MNIST dataset
mnist = keras.datasets.mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
Normalize the input image so that each pixel value is between 0 and 1
train_images = train_images / 255.0
test_images = test_images / 255.0
Define the model architecture
model = keras.Sequential([
keras.layers.InputLayer(input_shape=(28, 28)),
keras.layers.Reshape(target_shape=(28, 28, 1)),
keras.layers.Conv2D(filters=12, kernel_size=(3, 3), activation='relu'),
keras.layers.MaxPooling2D(pool_size=(2, 2)),
keras.layers.Flatten(),
keras.layers.Dense(10)
])
Compile the model
model.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
Train the model
model.fit(train_images, train_labels, epochs=4, validation_split=0.1)
Evaluate baseline test accuracy and save the model for later usage
_, baseline_model_accuracy = model.evaluate(test_images, test_labels, verbose=0)
print('Baseline test accuracy:', baseline_model_accuracy)
Define the pruning parameters
pruning_params = {
'pruning_schedule': tfmot.sparsity.keras.PolynomialDecay(initial_sparsity=0.50,
final_sparsity=0.80,
begin_step=0,
end_step=100)
}
Apply pruning to the model
model_for_pruning = tfmot.sparsity.keras.prune_low_magnitude(model, **pruning_params)
Compile the pruned model
model_for_pruning.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
Fine-tune the pruned model
model_for_pruning.fit(train_images, train_labels, epochs=2, validation_split=0.1)
Evaluate pruned model accuracy
_, pruned_model_accuracy = model_for_pruning.evaluate(test_images, test_labels, verbose=0)
print('Pruned model test accuracy:', pruned_model_accuracy)
Save the pruned model
_, keras_file = tempfile.mkstemp('.h5')
tf.keras.models.save_model(model_for_pruning, keras_file, include_optimizer=False)
print(f"Model saved at {keras_file}")

`import tensorflow as tf
import tempfile
from tensorflow import keras
Load MNIST dataset
mnist = keras.datasets.mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
Normalize the input image so that each pixel value is between 0 and 1
train_images = train_images / 255.0
test_images = test_images / 255.0
Define the model architecture
model = keras.Sequential([
keras.layers.InputLayer(input_shape=(28, 28)),
keras.layers.Reshape(target_shape=(28, 28, 1)),
keras.layers.Conv2D(filters=12, kernel_size=(3, 3), activation='relu'),
keras.layers.MaxPooling2D(pool_size=(2, 2)),
keras.layers.Flatten(),
keras.layers.Dense(10)
])
Compile the model
model.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
Train the model
model.fit(train_images, train_labels, epochs=4, validation_split=0.1)
Evaluate baseline test accuracy and save the model for later usage
_, baseline_model_accuracy = model.evaluate(test_images, test_labels, verbose=0)
print('Baseline test accuracy:', baseline_model_accuracy)
Define the pruning parameters
pruning_params = {
'pruning_schedule': tfmot.sparsity.keras.PolynomialDecay(initial_sparsity=0.50,
final_sparsity=0.80,
begin_step=0,
end_step=100)
}
Apply pruning to the model
model_for_pruning = tfmot.sparsity.keras.prune_low_magnitude(model, **pruning_params)
Compile the pruned model
model_for_pruning.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
Fine-tune the pruned model
model_for_pruning.fit(train_images, train_labels, epochs=2, validation_split=0.1)
Evaluate pruned model accuracy
_, pruned_model_accuracy = model_for_pruning.evaluate(test_images, test_labels, verbose=0)
print('Pruned model test accuracy:', pruned_model_accuracy)
Save the pruned model
_, keras_file = tempfile.mkstemp('.h5')
tf.keras.models.save_model(model_for_pruning, keras_file, include_optimizer=False)
print(f"Model saved at {keras_file}")
`

const tf = @.***/tfjs-node');
// Load MNIST dataset
const mnist = tf.data.mnist;
const { trainImages, trainLabels, testImages, testLabels } = mnist.getData();
// Normalize the input image so that each pixel value is between 0 and 1
const normalizedTrainImages = trainImages.div(255);
const normalizedTestImages = testImages.div(255);
// Define the model architecture
const model = tf.sequential();
model.add(tf.layers.inputLayer({ inputShape: [28, 28] }));
model.add(tf.layers.reshape({ targetShape: [28, 28, 1] }));
model.add(tf.layers.conv2d({ filters: 12, kernelSize: [3, 3], activation: 'relu' }));
model.add(tf.layers.maxPooling2d({ poolSize: [2, 2] }));
model.add(tf.layers.flatten());
model.add(tf.layers.dense({ units: 10 }));
// Compile the model
model.compile({
optimizer: 'adam',
loss: 'sparseCategoricalCrossentropy',
metrics: ['accuracy'],
});
// Train the model
await model.fit(normalizedTrainImages, trainLabels, { epochs: 4, validationSplit: 0.1 });
// Evaluate baseline test accuracy
const baselineModelAccuracy = await model.evaluate(normalizedTestImages, testLabels);
console.log('Baseline test accuracy:', baselineModelAccuracy[1]);
// Define the pruning parameters
const pruningParams = {
pruningSchedule: tfmot.sparsity.polynomialDecay({
initialSparsity: 0.50,
finalSparsity: 0.80,
beginStep: 0,
endStep: 100,
}),
};
// Apply pruning to the model
const prunedModel = tfmot.sparsity.pruneLowMagnitude(model, pruningParams);
// Compile the pruned model
prunedModel.compile({
optimizer: 'adam',
loss: 'sparseCategoricalCrossentropy',
metrics: ['accuracy'],
});
// Fine-tune the pruned model
await prunedModel.fit(normalizedTrainImages, trainLabels, { epochs: 2, validationSplit: 0.1 });
// Evaluate pruned model accuracy
const prunedModelAccuracy = await prunedModel.evaluate(normalizedTestImages, testLabels);
console.log('Pruned model test accuracy:', prunedModelAccuracy[1]);
// Save the pruned model
await prunedModel.save('file://path/to/your/model');
console.log('Pruned model saved.');
REGARDS,
KRISHNA MISHRA
JANAKPUR-2,NEPAL
E-MAIL:- @.***

From: Santabot123 @.>
Sent: Friday, February 9, 2024 6:59 PM
To: tensorflow/tensorflow @.>
Cc: Subscribed @.***>
Subject: [tensorflow/tensorflow] An error in the official pruning guide (Issue #62929)
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.15
Custom code
No
OS platform and distribution
Google Colab
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 behavior?
I followed this official pruning guide: https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras
I opened code in google colab (https://colab.research.google.com/github/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/pruning/pruning_with_keras.ipynb) and ran all cells..
And there is an ValueError: prune_low_magnitude can only prune an object of the following types: keras.models.Sequential, keras functional model, keras.layers.Layer, list of keras.layers.Layer. You passed an object of type: Sequential. in line model_for_pruning = prune_low_magnitude(model, **pruning_params)
I tried this code on my local machine and it gives the same error.
This looks like an bug.
Standalone code to reproduce the issue
Code from offical guide: https://colab.research.google.com/github/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/pruning/pruning_with_keras.ipynb
Relevant log output
No response
—
Reply to this email directly, view it on GitHubhttps://github.com/tensorflow/tensorflow/issues/62929, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZCZ53ZDUVNIQNPWNCCHJYLYSYOMRAVCNFSM6AAAAABDBODQVKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZDOMJRHA3TANI.
You are receiving this because you are subscribed to this thread.Message ID: @.***>

I solved this problem with:
! pip install tf-keras
and replace from tensorflow import keras  with  import tf_keras as keras

@Santabot123,
I tried to execute the mentioned official document with the tensorflow v2.15, keras v3.0 and the tensorflow-model-optimization - 0.8.0 and it was executed without any issue/error. Kindly find the gist of it here. Thank you!

authors: ChrisnaMishra Santabot123 tilakrayal


text:
Problem with tf.keras.layers.SimpleRNNCell

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.17.0
Custom code
Yes
OS platform and distribution
Linux Ubuntu 20.04
Mobile device
No response
Python version
3.11.0
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
12.3
GPU model and memory
NVIDIA GeForce RTX 4070Ti
Current behavior?
Current behavior is I get error message 'InaccessibleTensorError' due to line 'out0, state0 = self.RNNCell0(word, states=state0, training=training)'
Standalone code to reproduce the issue
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = "2"

import tensorflow as tf
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.optimizers import Adam

tf.random.set_seed(22)
np.random.seed(22)
assert tf.__version__.startswith('2.')

batch_size = 128
total_words = 10000
max_review_len = 80
embedding_len = 100

(x_train, y_train), (x_test, y_test) = tf.keras.datasets.imdb.load_data(num_words=total_words)
x_train = tf.keras.preprocessing.sequence.pad_sequences(x_train, maxlen=max_review_len)
x_test = tf.keras.preprocessing.sequence.pad_sequences(x_test, maxlen=max_review_len)

train_data = tf.data.Dataset.from_tensor_slices((x_train, y_train))
train_data = train_data.shuffle(10000).batch(batch_size, drop_remainder=True)

test_data = tf.data.Dataset.from_tensor_slices((x_test, y_test))
test_data = test_data.batch(batch_size, drop_remainder=True)

print('x_train_shape:', x_train.shape, tf.reduce_max(y_train), tf.reduce_min(y_train))
print('x_test_shape:', x_test.shape)

class RNN_Build(tf.keras.Model):
    def __init__(self, units):
        super(RNN_Build, self).__init__()
        self.state0 = [tf.zeros([batch_size, units])]
        self.state1 = [tf.zeros([batch_size, units])]
        self.embedding = tf.keras.layers.Embedding(total_words, embedding_len,
                                                   input_length=max_review_len)
        self.RNNCell0 = tf.keras.layers.SimpleRNNCell(units, dropout=0.2)
        self.RNNCell1 = tf.keras.layers.SimpleRNNCell(units, dropout=0.2)
        self.RNNCell1 = tf.keras.layers.SimpleRNNCell(units, dropout=0.2)
    def call(self, inputs, training=None):
        x = inputs
        x = self.embedding(x)
        state0 = self.state0
        state1 = self.state1
        for word in tf.unstack(x, axis=1):
            out0, state0 = self.RNNCell0(word, states=state0, training=training)
            out1, state1 = self.RNNCell1(out0, states=state1, training=training)
        x = self.outlayer(out1)
        prob = tf.sigmoid(x)
        return prob
import time
units = 64
epochs = 4
t0 = time.time()
model = RNN_Build(units)
model.compile(optimizer=tf.keras.optimizers.Adam(0.001),
              loss=tf.losses.BinaryCrossentropy(),
              metrics=['accuracy'])
model.fit(train_data, epochs=epochs, validation_data=test_data, validation_freq=2)

Relevant log output
---------------------------------------------------------------------------
InaccessibleTensorError                   Traceback (most recent call last)
Cell In[5], line 9
      5 model = RNN_Build(units)
      6 model.compile(optimizer=tf.keras.optimizers.Adam(0.001),
      7               loss=tf.losses.BinaryCrossentropy(),
      8               metrics=['accuracy'])
----> 9 model.fit(train_data, epochs=epochs, validation_data=test_data, validation_freq=2)

File /usr/local/lib/python3.11/dist-packages/keras/src/utils/traceback_utils.py:122, in filter_traceback.<locals>.error_handler(*args, **kwargs)
    119     filtered_tb = _process_traceback_frames(e.__traceback__)
    120     # To get the full stack trace, call:
    121     # `keras.config.disable_traceback_filtering()`
--> 122     raise e.with_traceback(filtered_tb) from None
    123 finally:
    124     del filtered_tb

Cell In[4], line 17
     15 state1 = self.state1
     16 for word in tf.unstack(x, axis=1):
---> 17     out0, state0 = self.RNNCell0(word, states=state0, training=training)
     18     out1, state1 = self.RNNCell1(out0, states=state1, training=training)
     19 x = self.outlayer(out1)

File /usr/local/lib/python3.11/dist-packages/tensorflow/core/function/capture/capture_container.py:144, in FunctionCaptures.capture_by_value(self, graph, tensor, name)
...

Arguments received by SimpleRNNCell.call():
  • sequence=tf.Tensor(shape=(128, 100), dtype=float32)
  • states=['tf.Tensor(shape=(128, 64), dtype=float32)']
  • training=True
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Hi @Zofns ,
I tried to run your code on Colab using TF v2.17.0 & nightly and faced the same issue. Please find the gist here for reference.
Please post this issue on keras-team/keras repo. as this issue is more related to keras
Thank you!


text:
!##[TRENDING!]!## Bhad Bhabie Leaked Video Viral Files Updated -TikTok Star - BA5EH

29 seconds ago Bhad Bhabie L𝚎aked Video Viral On Social Media. Θ(ＷＡＴＣＨ VIDEO𝕊) Bhad Bhabie Viral ᴠɪᴅᴇᴏ ʟᴇᴀᴋᴇᴅ Update Files Trending On Social Media X Telegram
𝖶𝖺𝗍𝖼𝗁 🟢 ➤ ➤ ➤ 🌐 𝖢𝗅𝗂𝖼𝗄 𝖧𝖾𝗋𝖾 𝖳𝗈 𝗅𝗂𝗇𝗄 (𝖥𝗎𝗅 𝗅 𝖵𝗂𝗋𝖺𝗅 𝖵𝗂𝖽𝖾𝗈 𝖫𝗂𝗇𝗄)
🔴 ➤► 𝖣𝖮𝖶𝖭𝖫𝖮𝖠𝖣👉👉 (𝖥𝗎𝗅𝗅 𝖵𝗂𝗋𝖺𝗅 𝖵𝗂𝖽𝖾𝗈 𝖫𝗂𝗇 𝗄) 𝖶𝖺𝗍𝖼𝗁
🟢 ➤ ➤ ➤ 🌐 𝖢𝗅𝗂𝖼𝗄 𝖧𝖾𝗋𝖾 𝖳𝗈 𝗅𝗂𝗇𝗄 (𝖥𝗎𝗅𝗅 𝖵𝗂𝗋𝖺 𝗅 𝖵𝗂𝖽𝖾𝗈 𝖫𝗂𝗇𝗄)
🔴 ➤► 𝖣𝖮𝖶𝖭𝖫𝖮𝖠𝖣👉👉 (𝖥𝗎𝗅𝗅 𝖵𝗂𝗋𝖺𝗅 𝖵𝗂𝖽𝖾𝗈 𝖫𝗂𝗇 𝗄)
L𝚎aked Video Bhad Bhabie Original Video Viral Video L𝚎aked on X Twitter Telegram
Bhad Bhabie Dark Video Female Bhad Bhabie Dark Video Link Viral On Social Media X TikTok Trending Now
𝖫𝖾𝖺𝚔𝖾𝖽 𝗏𝗂𝗋𝖺𝗅 𝗅𝗂𝗇𝗄 2024 𝖫𝖾𝖺𝚔𝖾𝖽 𝖵𝗂𝖽𝖾𝗈 𝖵𝗂𝗋𝖺𝗅 𝖮𝗇 𝖲𝗈𝖼𝗂𝖺𝗅 𝖬𝖾𝖽𝗂𝖺 2024.𝖫𝖾𝖺𝚔𝖾𝖽 𝗏𝗂𝗋𝖺𝗅 𝗅𝗂𝗇𝗄 2024 𝖫𝖾𝖺𝚔𝖾𝖽 𝖵𝗂𝖽𝖾𝗈 𝖵𝗂𝗋𝖺𝗅 𝖮𝗇 𝖲𝗈𝖼𝗂𝖺𝗅 𝖬𝖾𝖽𝗂𝖺 2024. 𝖳𝗁𝖾 𝗋𝖾𝖼𝗎𝗋𝗋𝖾𝗇𝗍 𝗍𝗁𝖾𝗆𝖾 𝗈𝖿 𝖫𝖾𝖺𝚔𝖾𝖽 𝗍𝖺𝗉𝖾𝗌 𝖺𝗇𝖽 𝗍𝗁𝖾 𝗌𝗎𝖻𝗌𝖾𝗊𝗎𝖾𝗇𝗍 𝖿𝖺𝗅𝗅𝗈𝗎𝗍 𝗌𝖾𝗋𝗏𝖾𝗌 𝖺𝗌 𝖺 𝗋𝖾𝗆𝗂𝗇𝖽𝖾𝗋 𝗈𝖿 𝗍𝗁𝖾 𝖿𝗋𝖺𝗀𝗂𝗅𝗂𝗍𝗒 𝗈𝖿 𝗋𝖾𝗉𝗎𝗍𝖺𝗍𝗂𝗈𝗇 𝗂𝗇 𝗍𝗁𝖾 𝖽𝗂𝗀𝗂𝗍𝖺𝗅 𝖾𝗋𝖺. 𝖠𝗌 𝗍𝗁𝖾 𝗅𝗂𝗇𝖾𝗌 𝖻𝖾𝗍𝗐𝖾𝖾𝗇 𝗉𝗋𝗂𝗏𝖺𝗍𝖾 𝖺𝗇𝖽 𝗉𝗎𝖻𝗅𝗂𝖼 𝗅𝗂𝖿𝖾 𝖼𝗈𝗇𝗍𝗂𝗇𝗎𝖾 𝗍𝗈 𝖻𝗅𝗎𝗋, 𝖼𝖾𝗅𝖾𝖻𝗋𝗂𝗍𝗂𝖾𝗌 𝗅𝗂𝗄𝖾 𝖯𝗋𝗂𝗌𝗈𝗇 𝖮𝖿𝖿𝗂𝖼𝖾𝗋𝖿𝗂𝗇𝖽 𝗍𝗁𝖾𝗆𝗌𝖾𝗅𝗏𝖾𝗌 𝖺𝗍 𝗍𝗁𝖾 𝗆𝖾𝗋𝖼𝗒 𝗈𝖿 𝗂𝗇𝗍𝖾𝗋𝗇𝖾𝗍 𝖼𝗁𝖺𝗍𝗍𝖾𝗋, 𝗐𝗁𝖾𝗋𝖾 𝖺 𝗋𝗎𝗆𝗈𝗋 𝖼𝖺𝗇 𝗂𝗀𝗇𝗂𝗍𝖾 𝖺 𝖿𝗂𝗋𝖾𝗌𝗍𝗈𝗋𝗆 𝗈𝖿 𝗌𝗉𝖾𝖼𝗎𝗅𝖺𝗍𝗂𝗈𝗇 𝖺𝗇𝖽 𝗃𝗎𝖽𝗀𝗆𝖾𝗇𝗍.
𝖨𝗇 𝗍𝗁𝖾 𝖾𝗏𝖾𝗋 𝖾𝗏𝗈𝗅𝗏𝗂𝗇𝗀 𝗅𝖺𝗇𝖽𝗌𝖼𝖺𝗉𝖾 𝗈𝖿 𝖼𝖾𝗅𝖾𝖻𝗋𝗂𝗍𝗒 𝖼𝗎𝗅𝗍𝗎𝗋𝖾, 𝗍𝗁𝖾 𝖨𝗌𝗁𝗈𝗐𝗌𝗉𝖾𝖾𝖽𝗌𝖼𝖺𝗇𝖽𝖺𝗅 𝗎𝗇𝖽𝖾𝗋𝗌𝖼𝗈𝗋𝖾𝗌 𝗍𝗁𝖾 𝗋𝖾𝗅𝖾𝗇𝗍𝗅𝖾𝗌𝗌 𝗉𝗎𝗋𝗌𝗎𝗂𝗍 𝗈𝖿 𝗌𝖾𝗇𝗌𝖺𝗍𝗂𝗈𝗇𝖺𝗅𝗂𝗌𝗆, 𝖺 𝗉𝗎𝗋𝗌𝗎𝗂𝗍 𝗍𝗁𝖺𝗍 𝗈𝖿𝗍𝖾𝗇 𝖼𝗈𝗆𝖾𝗌 𝖺𝗍 𝗍𝗁𝖾 𝖾𝗑𝗉𝖾𝗇𝗌𝖾 𝗈𝖿 𝗍𝗋𝗎𝗍𝗁 𝖺𝗇𝖽 𝖽𝗂𝗀𝗇𝗂𝗍𝗒. 𝖠𝗌 𝗐𝖾 𝗇𝖺𝗏𝗂𝗀𝖺𝗍𝖾 𝗍𝗁𝖾 𝖼𝗈𝗆𝗉𝗅𝖾𝗑𝗂𝗍𝗂𝖾𝗌 𝗈𝖿 𝗍𝗁𝖾 𝖽𝗂𝗀𝗂𝗍𝖺𝗅 𝖺𝗀𝖾, 𝗍𝗁𝖾 𝗅𝗂𝗇𝖾 𝖻𝖾𝗍𝗐𝖾𝖾𝗇 𝖾𝗇𝗍𝖾𝗋𝗍𝖺𝗂𝗇𝗆𝖾𝗇𝗍 𝖺𝗇𝖽 𝖾𝗑𝗉𝗅𝗈𝗂𝗍𝖺𝗍𝗂𝗈𝗇 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 𝗉𝖾𝗋𝗂𝗅𝗈𝗎𝗌𝗅𝗒 𝗍𝗁𝗂𝗇.
𝖠𝗌 𝗍𝗁𝖾 𝗌𝗂𝗍𝗎𝖺𝗍𝗂𝗈𝗇 𝗎𝗇𝖿𝗈𝗅𝖽𝗌, 𝗍𝗁𝖾 𝗍𝗋𝗎𝗍𝗁 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 𝗌𝗁𝗋𝗈𝗎𝖽𝖾𝖽 𝗂𝗇 𝗆𝗒𝗌𝗍𝖾𝗋𝗒, 𝗅𝖾𝖺𝗏𝗂𝗇𝗀 𝗍𝗁𝖾 𝗉𝗎𝖻𝗅𝗂𝖼 𝗍𝗈 𝗉𝗈𝗇𝖽𝖾𝗋 𝗍𝗁𝖾 𝖺𝗎𝗍𝗁𝖾𝗇𝗍𝗂𝖼𝗂𝗍𝗒 𝗈𝖿 𝗍𝗁𝖾 𝗋𝗎𝗆𝗈𝗋𝗌. 𝖨𝗇 𝖺 𝗐𝗈𝗋𝗅𝖽 𝗐𝗁𝖾𝗋𝖾 𝖿𝖺𝗆𝖾 𝖺𝗇𝖽 𝗂𝗇𝖿𝖺𝗆𝗒 𝖺𝗋𝖾 𝗍𝗐𝗈 𝗌𝗂𝖽𝖾𝗌 𝗈𝖿 𝗍𝗁𝖾 𝗌𝖺𝗆𝖾 𝖼𝗈𝗂𝗇, 𝗍𝗁𝖾 𝗌𝖺𝗀𝖺 𝗈𝖿 𝖨𝗌𝗁𝗈𝗐𝗌𝗉𝖾𝖾𝖽𝗂𝗌 𝖺 𝗍𝖾𝗌𝗍𝖺𝗆𝖾𝗇𝗍 𝗍𝗈 𝗍𝗁𝖾 𝗉𝗈𝗐𝖾𝗋 𝗈𝖿 𝗌𝗈𝖼𝗂𝖺𝗅 𝗆𝖾𝖽𝗂𝖺 𝗍𝗈 𝗌𝗁𝖺𝗉𝖾 𝗇𝖺𝗋𝗋𝖺𝗍𝗂𝗏𝖾𝗌 𝖺𝗇𝖽 𝖼𝗁𝖺𝗅𝗅𝖾𝗇𝗀𝖾 𝗍𝗁𝖾 𝖻𝗈𝗎𝗇𝖽𝖺𝗋𝗂𝖾𝗌 𝗈𝖿 𝗉𝗋𝗂𝗏𝖺𝖼𝗒 𝖺𝗇𝖽 𝖼𝗈𝗇𝗌𝖾𝗇𝗍.
Bhad Bhabie Original Video video took the internet by storm and amazed viewers on various social media platforms. Bhad Bhabie , a young and talented digital creator, recently became famous thanks to this interesting video.
L𝚎aked Video Bhad Bhabie Original Video Viral Video L𝚎aked on X Twitter
Bhad Bhabie Original Video video oficial twitter
L𝚎aked Video Bhad Bhabie Original Video Viral Video L𝚎aked on X Twitter.
.
.
.
.
.
Bhad Bhabie's latest video has taken the internet by storm, sparking lively discussions across various social media platforms. The rising digital influencer, known for her captivating content—especially her recent Spiderman-themed video—has experienced a massive surge in popularity. Fans are eagerly awaiting the full version, while audiences flock to Instagram, X (formerly Twitter), and Discord to engage with her latest creation.
As excitement continues to grow, fans are actively sharing their thoughts online, highlighting the crucial role social media plays in propelling creators like Bhad Bhabie into the spotlight. With her unique style and creative approach, she has made a significant impact on the digital scene, leaving fans excited for what’s to come next. The viral success of her video further underscores the power of social media in boosting visibility and fostering stronger connections between creators and their audiences.
.
..
In the digital age, content spreads at an unprecedented speed. Social media has transformed how we communicate, share, and consume information. From trending topics to viral videos, platforms like Twitter, TikTok, Instagram, and Facebook have become central to modern discourse. Amid this environment, the name "Bhad Bhabie" has gained significant attention following the leak of a controversial video. The so-called "Bhad Bhabie Leaked video" became viral, making waves on various social media platforms and sparking a debate on privacy, online safety, and the implications of going viral.
This article aims to delve into the phenomenon of the Bhad Bhabie Leaked video, examining its origins, how it became viral, and the broader implications of such content in the age of social media virality. It also explores the ethical and legal dimensions surrounding Leaked videos and the influence of digital culture on personal privacy.zxvs.
.
..//

Closing this issue as a spam.

@##@#@#

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.
.
.
@##@#@#

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
@##@#@#

.
.
.
.
.
.
.
@##@#@#

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
@##@#@#

.
.
bbbbbbbbbbbbbbbbbbbb

authors: aaMssethi neukusufw tilakrayal


text:
Use com.android.support.test instead of com.androidx.test

This PR should fix https://github.com/tensorflow/tensorflow/issues/20748 and https://github.com/tensorflow/tensorflow/issues/20828

Was this fixed with https://github.com/tensorflow/tensorflow/commit/1d38580d6db3dc48b916453c2ce6cce691a00fe6? If so I'll just close this.

Yea, I'm all good thanks. Closing this now.

source: gharchive/pull-request


text:
Minimal ACL Integration

Adds interfaces to offload kernels to Arm Compute Library.
This is a minimal integration effort and further steps are needed.
Bazel dependency is still not in place, thus the makefile system can be used for testing.
More details can be found in README.md file under the acl backend.

Hi @GeorgeARM, looks like you've been busy! Let's sync offline about next steps on this, we'd like to patch this in and run some tests on our end.

Can one of the admins verify this patch?

@GeorgeARM can you please resolve conflicts ?

Per offline conversation, this PR is mostly a prototype and proof of concept. We won't be landing directly as-is, however, we will be looking at hosting and developing this externally, and coordinating on integration and use with TFLite.

Abandoning this PR.

authors: GeorgeARM jdduke mellanox-github rthadur


text:
fixes #35136

fixes #35136

We cannot accept PRs to r2.0 or other release branches after the corresponding release has finished, except if they are related to a patch release for security.

I tried changing base to master but there are some conflicting commits so it would need your work to rebase. Please reopen against master

authors: mihaimaruseac ymodak


text:
Test Squeeze op converter in dynamic shape mode

This PR adds tests for dynamic shape mode for TF-TRT ConvertSqueeze.

The BuildAndRun method is extended with a profile generation step.
ConvertSqueeze is refactored: all test use TestParams
All previous test in ConvertSqueeze run both in implicit and explicit batch mode
Added new dynamic shapes tests (those run only in explicit batch mode)

PR #38118 is required for of this PR, please review that first. Tagging @bixia1 for review.

@tfeher Can you please check @bixia1 comments and keep us posted. Thanks!

Thanks @bixia1 for the review. I am working on fixing the issues, I will update soon.

authors: gbaned tfeher


text:
[TFLite] Add int8 and int16x8 support for the REDUCE_PROD operator

Hello,
This PR adds int8 and int16x8 support for the REDUCE_PROD operator.
Ideally the kernel should do the product of all the quantized elements in the reduced axes and then do a final rescale:

This would give the best accuracy but unfortunately it would quickly overflow the accumulator. To overcome the issue the product is rescaled at each step in a way similar to

with a slight modification that the rescaling is done after each in_i*in_i+1 multiplication plus a final rescaling to avoid losing too much precision by rescaling each in_i individually.
Note that it can degenerate to a precision of 0 if an intermediate results is too close to 0 and becomes a quantized 0. Example 1.5 * 0.5 * 0.1 * 0.01 * 5.3 * 8.3 * 2.3 * 9.6 * 10.2 = 7.43043888 but the intermediate 1.5 * 0.5 * 0.1 * 0.01 = 0.00075 could become a quantized 0 and the whole quantized result will be 0 instead of something close to 7.4. It's unfortunately difficult to avoid it without a dynamic rescaling (and thus dynamic rescaling factor) that would rescale the accumulator once it is too close to its minimum/maximum value.
It could also happen if the 0.01 input in the example end-up to be quantized as a 0 (which would happen with the [0;10.2] range of the example using 8-bit as the quantized step would be 10.2 / 255 = 0.04).
These cases should hopefully be infrequent.
Thibaut

Removing myself as reviewer since this is a PR changing tflite and I'm focused of TFLM.

@abattery  Can you please review this PR ? Thanks!

Thank you for the review, I addressed the comments and updated the PR.

@jianlijianli I updated the PR to adapt it to some changes from the master branch. The PR will need a re-approval, thanks!

Closing as it seems it has been merged.

authors: Tessil advaitjain gbaned


text:
Fix cuDNN LSTM implementation selection with LoadSavedModel C++ API.

If I save tf.keras.layers.LSTM layer with _could_use_gpu_kernel=True into the SavedModel format with tf.saved_model.save, then cuDNN kernel is used when I load this model with tf.saved_model.load and it works fast. But if I load this model from C++ with tensorflow::LoadSavedModel function, then cuDNN kernel isn't used and it is slow.
Here is colab demonstrating the issue https://colab.research.google.com/drive/16WN0sqOoL37M7-5XMhGb-irkRX7fh503?usp=sharing . If model is loaded with tf.saved_model.load, then tf.keras.layers.LSTM and tf.raw_ops.CudnnLSTM layers both takes about 100 ms. But if model is loaded with LoadSavedModel from C++, then tf.keras.layers.LSTM takes about 275 ms, while tf.raw_ops.CudnnLSTM takes 100 ms.
There were some problems in FunctionOptimizer, ImplementationSelector and MetaOptimizer optimizers:

When FunctionOptimizer specialized some function, it copied api_implements from origin function to specialization. It caused  an error "Function ... and ... both implment 'interface_name' but their signatures do not match" in FunctionLibraryApiInfo::Init
MetaOptimizer didn't pass whole FunctionDefLibrary along with a body of single function, which is needed for implementation selection.
ImplementationSelector couldn't parse empty device name if it isn't specified on a node.

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

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

@gbaned Fixed.

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

Adding @reedwm since @ezhulenev is on vacation for a while.

@ezhulenev, can you take a look? I'm not very familiar with the grappler passes this PR modifies.

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

This PR is still required. I can rebase it to master again if needed. But I don't understand what have I to do to merge it. I rebased a year ago, all tests passed, PR was approved but not merged and no comments where given. Should I fix or change anything in this PR?

I think it failed some internal test (due to frequent breakages) and then it became stale. Sorry about that

Hi @API92 , Can you please resolve the conflicts? Thank you!

authors: API92 gbaned keerthanakadiri mihaimaruseac penpornk reedwm


text:
s390x support to Int4FromProtoField (tensor.cc)

Code changes needed to fix test case failure : //tensorflow/c/experimental/saved_model/core:constant_loading_test
The variable, data is initialized as:
int8_t* data = buf->template base<int8_t>();
So, it's value affects the buffer value (buf) which is considered for the output. The base() function of the TensorBuffer class (buf), casts the uint8/int8 data back to desired type (uint4/int4) using reinterpret_cast which depends on the endianess of the system. Hence simply swapped the bits of the data pointer values so that the buffer can interpret the values of data according to  big endian systems (s390x platform)

Please review

Hi @wilsingosti ,Can you please review this PR? Thank you !

authors: Nayana-ibm keerthanakadiri


text:
Allow TensorLike objects for oneHot.

Allows a TensorLike1D (an array) for tf.oneHot.

This change is

Review status: :shipit: complete! 1 of 1 LGTMs obtained

Comments from Reviewable

 If this is fixing an issue, add Fixes ISSUE_LINK to the desc and the issue will be auto-closed with submission of this PR

Reviewed 2 of 2 files at r1.
Review status: :shipit: complete! 2 of 1 LGTMs obtained

Comments from Reviewable

authors: bileschi dsmilkov nsthorat

repo: tensorflow/tfjs-core

license_source: bigquery


text:
Cannot convert a symbolic Keras input/output to a numpy array

System information

OS Platform and Distribution: Linux Ubuntu 20.10
TensorFlow version: 2.4.1
Python version: 3.8

Describe the problem
I need to implement a custom convolution 2D layer which is not supported by Tensorflow and TF Lite, so I tried to define it by using this link: https://www.tensorflow.org/guide/create_op (in order to have a TF operator for the op) and this link: https://www.tensorflow.org/lite/guide/ops_custom (to have a TF Lite operator for this op). I can train the model; however, when I try to convert the model with the operator with TF Lite converter, I get this error:
 Traceback (most recent call last):
 File "es.py", line 39, in <module>
 converter =
 tf.lite.TFLiteConverter.from_concrete_functions([tf.function(convol1d).get_concrete_function(inp)])
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py",
 line 1299, in get_concrete_function concrete =
 self._get_concrete_function_garbage_collected(*args, **kwargs)
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py",
 line 1205, in _get_concrete_function_garbage_collected
 self._initialize(args, kwargs, add_initializers_to=initializers)
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/def_function.py",
 line 725, in _initialize
 self._stateful_fn._get_concrete_function_internal_garbage_collected(  # pylint: disable=protected-
 access
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py", line
 2969, in _get_concrete_function_internal_garbage_collected
 graph_function, _ = self._maybe_define_function(args, kwargs)
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py", line
 3314, in _maybe_define_function
 self._function_spec.canonicalize_function_inputs(*args, **kwargs)
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py", line
 2697, in canonicalize_function_inputs
 inputs, flat_inputs, filtered_flat_inputs = _convert_numpy_inputs(inputs)
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py", line
 2753, in _convert_numpy_inputs
 a = _as_ndarray(value)
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/eager/function.py", line
 2711, in _as_ndarray
 return value.__array__()
 File "/home/em/venv/lib/python3.8/site-packages/tensorflow/python/keras/engine
 /keras_tensor.py", line 273, in __array__
 raise TypeError(
 TypeError: Cannot convert a symbolic Keras input/output to a numpy array. This error may
 indicate that you're trying to pass a symbolic value to a NumPy call, which is not supported. Or,
 you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register
 dispatching, preventing Keras from automatically converting the API call to a lambda layer in the
 Functional Model.

The example code is like this:
import tensorflow as tf
tf.config.run_functions_eagerly(True)
from keras.datasets import mnist
from keras.models import Model
from keras.layers import add,Input,Activation,Flatten,Dense

def convol(inp):
     conv_module = tf.load_op_library('./conv.so')
     x = conv_module.conv(inp, name="Conv")
     return x

def read_mnist(path):
     (train_x,train_y), (test_x,test_y)=mnist.load_data()
     return train_x,train_y,test_x,test_y

def tcn(train_x,train_y,test_x,test_y):
     inp=Input(shape=(28,28))
     x = convol(inp)
     x=Flatten()(x)
     x=Dense(10,activation='softmax')(x)
     model=Model(inputs=inp,outputs=x)
     model.summary()
     model.compile(loss='sparse_categorical_crossentropy', optimizer='adam', metrics=
     ['accuracy'])
     model.fit(train_x,train_y,batch_size=100,epochs=10,validation_data=(test_x,test_y))
     pred=model.evaluate(test_x,test_y,batch_size=100)
     print('test_loss:',pred[0],'- test_acc:',pred[1])

 train_x,train_y,test_x,test_y=read_mnist('MNIST_data')
 tcn(train_x,train_y,test_x,test_y)
 tflite_model_name = 'net'
 inp=Input(shape=(28,28))
 converter =
 tf.lite.TFLiteConverter.from_concrete_functions([tf.function(convol).get_concrete_function(inp)])
 converter.allow_custom_ops = True
 tflite_model = converter.convert()
 open(tflite_model_name + '.tflite', 'wb').write(tflite_model)

I think the problem is due to the fact that TF Lite converter receives a Keras Tensor (a placeholder) rather than an array numpy, but I'm not sure how I could convert the model if I have to use a TF Lite custom op.

For general converter issues, we would refer you to the TfLite mailing list or other links listed in https://github.com/tensorflow/tflite-micro#getting-help

repo: tensorflow/tflite-micro


text:
ci(Make): add test jobs for compression

Add GitHub CI jobs that run make test, etc. with compression
enabled. Add as new jobs, as opposed to additional steps within
the existing jobs, so they can run in parallel, and so they begin
with a fresh, un-built working directory.
BUG=part of #2636

This PR adds CI jobs.


text:
Dark and Light Mode Switch

This PR creates the switch which will be used to toggle between the dark mode and light mode. The functionality is yet to follow.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

@roughcoding I'm done with the light theme implementation. Your review is welcome.

@roughcoding kindly clarify what you mean by the "The alteration of the shape of the images?". I think the remaining ones are clear

@roughcoding kindly clarify what you mean by the "The alteration of the shape of the images?". I think the remaining ones are clear

@Mupati Will attach the screenshots along, hope it explains. I think it could be due to some global CSS rules affecting those images(Logo and repository image).
Screenshot of version, before theme-switch implementation.

Screenshot of the version after theme-switch.

@roughcoding  I've submitted a PR for the requested changes

authors: CLAassistant Mupati roughcoding

repo: tensorwerk/hangar-gui


text:
Pip warning at build time about incompatible numpy / numba dependencies

I noticed the following as part of a build:
ERROR: numba 0.56.4 has requirement numpy<1.24,>=1.18, but you'll have numpy 1.24.4 which is incompatible.

Seen as part of the build here:
https://github.com/tenstorrent-metal/tt-metal/actions/runs/7867635921/job/21463612011
Might be harmless? Either way, it's a bit of noise in the build system that could be good to get rid of. Perhaps easiest to just move to more modern versions of all dependencies, but I'm not sure how many subtle dependency fixups might be needed, so not going to do it casually.
Cc: @tt-rkim

I've checked pipdeptree in a recent commit and some recent workflows - not seeing this anymore.
We also have a numba pin, and looks like @cfjchu fixed for us
Thanks for flagging Olof - closing this now

authors: olofj tt-rkim

repo: tenstorrent-metal/tt-metal


text:
[MCW] Compare performance of the model on n150 compared to e150

Generate perf sheets for Segformer on e150 (from #11817) and n150 (from #11818)
Compare the perforamnce through FPS.
List the sub-tasks under this issue (if any)

On Hold. As per priority, we'll look into this.

repo: tenstorrent/tt-metal


text:
Llama3.1-8B and Mixtral non-deterministic output in demo_with_prefill.py

Describe the bug
Running Llama3.1-8B demo with prefill results in different outputs. All good outputs, but always different.
For now we've disabled the output token validation from main to avoid blocking CI.
To Reproduce
Tested on latest main ce56b42712429416485b377d30f88500bf243dfa.
Also tried the fixture (reset_seeds) but no luck. Double checked and we are doing argmax, so not sure where the variability is coming from.
I tried with a more robust prompt Can you describe and comment the following number sequence? 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, but as can be seen below, it still outputs a slightly different answer every time.
pytest models/demos/wormhole/llama31_8b/demo/demo_with_prefill.py::test_llama_demo[instruct_weights-1_batch]

Bad output
I've run multiple times and got different variations of the output. Examples below.
<|begin_of_text|><|start_header_id|>user<|end_header_id|>Can you describe and comment the following number sequence? 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163<|eot_id|><|start_header_id|>assistant<|end_header_id|>

The given number sequence appears to be a list of prime numbers. A prime number is a positive integer that is divisible only by itself and 1. In other words, it is a number that is not divisible by any other number except for 1 and itself.

Here are some observations and comments about the sequence:\n\n* The sequence starts with 2, which is the smallest prime number.
* The sequence consists of consecutive prime numbers, which is a notable property of prime numbers.
* The sequence appears to be a random collection of prime numbers, but it's actually a list of

---------

<|begin_of_text|><|start_header_id|>user<|end_header_id|>Can you describe and comment the following number sequence? 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163<|eot_id|><|start_header_id|>assistant<|end_header_id|>

The given number sequence appears to be a list of prime numbers. A prime number is a positive integer that is divisible only by itself and 1.

Here are some observations and comments about the sequence:

1. **Consecutive primes**: The sequence consists of consecutive prime numbers, which is a notable property. This means that each number in the sequence is a prime number, and the sequence is ordered in ascending order.

2. **No gaps**: There are no gaps in the sequence, meaning that every prime number up to a certain limit (in this case, 101) is

------

<|begin_of_text|><|start_header_id|>user<|end_header_id|>Can you describe and comment the following number sequence? 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163<|eot_id|><|start_header_id|>assistant<|end_header_id|>

The given number sequence appears to be a list of prime numbers. A prime number is a positive integer that is divisible only by itself and 1. In other words, it is a number that is not divisible by any other number except for 1 and itself.

Here are some observations and comments about the sequence:

1. **Consecutive primes**: The sequence starts with 2, which is the smallest prime number. The subsequent numbers in the sequence are consecutive prime numbers, i.e., 2, 3, 5, 7, 11, etc. are

This seems to be happening to Mixtral as well. Tested on branch mixtral-32k-demo

We see ND PCC in our t3k Llama attention tests. We isolated it to this commit https://github.com/tenstorrent/tt-metal/commit/7b8e627c078e8262a22df07627b00b2f1d645abb#diff-dcb2b8d4bed26e70b5f09bd34fcce0e81d7a8770a96ecf79ac753e4e27559af2

Probably the same: https://github.com/tenstorrent/tt-metal/issues/11438

For llama3.1-8B on branch aho/unpacker-delay I'm not seeing variability anymore.
The test_model is showing PCC = 0.9632  (we had a cutoff a 0.94), so this was an improvement as well.

Correct me if I am wrong, but both the commit that caused the non-determinism and the fix are not expected to change the math, so we should expect to get the same PCC as before (unless some other change in between changed the math). The fact that pcc is not the same, even if it is 0.96, might point to a problem.

@uaydonat My bad on the previous comment. I should've added a 'probably' or double checked with older pipelines.
Although our PCC cutoff is 0.94, before this variability issue was introduced the PCC was already 0.9632( checked runs from 1 week and 2 weeks ago), so there wasn't any change there, as expected.

Is the fix in main? Should we close this?

authors: cglagovichTT mtairum uaydonat yieldthought


text:
Remove dependency on generated_bank_to_noc_coord_mapping.h

Users appear to be (1) Firmware and (2) dataflow_api.h (and therefore everything). Need to investigate how we can shift these dependencies to mailboxes or similar without degrading perf.

@spoojaryTT done?

Fix merged in c1a246e

authors: pgkeller spoojaryTT tt-dma


text:
ttl.tensor.transpose breaks with Equal check failed error [Wormhole]

ttl.tensor.transpose(input, 0, 2) breaks with low PCC error in some test cases.
To Reproduce
Steps to reproduce the behavior:

Checkout main branch
Run unit test test_transpose_nh.py using this command:
pytest tests/tt_eager/python_api_testing/non_working_unit_tests/wormhole/test_transpose_nh.py

Expected behavior
There is one test case presented in the unit test test_transpose_nh.py which is expected to fail with low PCC error, like this:
Max ATOL Delta: 197.0, Max RTOL Delta: nan, PCC: 0.9999514415204078, Equal check failed
Getting Additional info for the operation under test and its behavior
To get additional information and results for different combinations of input shapes, types, layouts and memory configs for which this operation was tested you can also run locally sweeps for ttl.tensor.transpose_nh and check the results. To do this you should:

Follow the Getting Started page to setup the repo, environment variables and python-env
Activate source build/python_env/bin/activate
Run sweeps by using python tests/tt_eager/python_api_testing/sweep_tests/run_pytorch_test.py -i tests/tt_eager/python_api_testing/sweep_tests/test_configs/ci_sweep_tests/broken_wormhole/pytorch_transpose_nh_test.yaml -o ./result-sweeps
After the run is completed all test sweeps results should be available inside specified output directory (in this case ./result-sweeps). There you will find transpose_nh_sweep.csv which holds all executed sweeps, among which you can also find the ones that failed and were recreated by the unit test, which you can get by searching unique data_seed field.

Find on ARA
Navigate to http://172.27.44.162:8080/op_test_sweeps
Select transpose_nh for the test sweep name and date interval to consists of 2023-10-16 09:11

@JelenaTosicJtosic is this still an open issue?

authors: JelenaTosicJtosic davorchap


text:
Dispatch and routing kernels. Disable debug counters.

Ticket
N/A
Problem description
Need to disable debug info / kernel status code in the routing kernels in prod. They are only used for testing.
What's changed

Make ifs constexpr in dispatch and prefetch kernels
In the packet queue kernels, timeout cycles can be made constexpr. Additionally, the kernel debug status info such as word counter doesn't need to be incremented in prod because nobody will check them. They are only used in test so properly disabling them by passing in an address of 0 should help speed it up a little.
Writing to L1[0] is already invalid

Next

Go into the FDKernels and set the test results address / kernel status to 0 to disable the counting.

Checklist

[ ] Post commit CI passes
Queued https://github.com/tenstorrent/tt-metal/actions/runs/12524321303
[ ] Blackhole Post commit (if applicable)
[ ] Model regression CI testing passes (if applicable)
[ ] Device performance regression CI testing passes (if applicable)
[ ] (For models and ops writers) Full new models tests passes
[ ] New/Existing tests provide coverage for changes

Post commit has passed now
https://github.com/tenstorrent/tt-metal/actions/runs/12524321303


text:
TTNN Generic Runtime Interface

This is a high level umbrella issue intended to give an overview of what we want to start building for a ttnn generic op.
First we should sync with Artem and Eyon and get their thoughts and opinion.  Any new APIs we create here will need sign off from them.
In the meantime, I think the below steps would be worth prototyping so we know what APIs to request and have a concrete plan for how this can work and interact with compiler needs.
Steps:

Build / clone tt-metal, run a simple TTNN Eltwise op (https://github.com/tenstorrent/tt-metal/blob/main/tt_eager/tt_dnn/op_library/eltwise_unary/eltwise_unary_op.hpp)
Familiarize yourself with the construction of the op:

How CBs are constructed
How kernels are built
How Programs are constructed

Create a new ttnn generic op interface something like:

void run_generic(std::vector<Tensor> const& tensors, ProgramDesc programDesc);

Extract the above eltwise kernels and embed them at the test level
Pass the tensors, kernels, and CB descs into the ttnn generic function

Sharing update per our conversation I have a generic op that is tested on couple examples like unary sqrt interleaved, unary sharded rely, binary add interleaved and binary add sharded.
Caching, python bindings and ethernet kernels are not implemented.
@pjanevskiTT will take a look into testing softmax and matmul to discover if we are fundamentally missing something. And will look to implement caching.
python bindings and ethernet kernels should be straighforward to add if/when we need them.
Sharing GenericOpDeviceOperation::operation_attributes_t that is equivalent to ProgramDesc from Nick's original message - this is work in progress version and we are yet to get feedback from TTNN folks.
struct circular_buffer_attributes_t {
    CoreRangeSet core_spec;
    uint32_t total_size;
    uint32_t page_size;
    tt::DataFormat data_format;

    // this needs better solution as we now have input tensors (std::vector) and output tensor so index is not great
    std::optional<int> set_globally_allocated_address = std::nullopt; // an index to io_tensors that will set globally allocated address on CB
};

struct data_movement_attributes_t {
    CoreRangeSet core_spec;
    std::string kernel_path;
    tt::tt_metal::DataMovementConfig config;
    std::unordered_map<CoreCoord, std::vector<uint32_t>> runtime_args_per_core = {};
};

struct compute_attributes_t {
    CoreRangeSet core_spec;
    std::string  kernel_path;
    tt::tt_metal::ComputeConfig config;
    std::unordered_map<CoreCoord, std::vector<uint32_t>> runtime_args_per_core = {};
};

struct operation_attributes_t {
    std::unordered_map<uint8_t, circular_buffer_attributes_t> circular_buffer_attributes;
    std::vector<data_movement_attributes_t> data_movement_attributes;
    // Ethernet not supported at the moment.
    // std::optional<tt::metal::EthernetConfig> ethernetConfig;
    std::vector<compute_attributes_t> compute_attributes;
};

Just to write down progress from the last update and expand on the work we have done so far for TTNN generic op
TTNN generic op structure
We wanted to confirm that the generic op structure has everything it needs to run custom setup of kernels, circular buffers,... In order to have confidence about that, we have additionaly tested

Softmax op - point of the test is to confirm whether we can support intermed circular buffers. Since these buffers are setup in a same way as input and output circular buffers, this wasn't a problem and the test passed
Matmul - point of the test is to confirm that we can support different kernels being loaded to different cores. Matmul is the obvious example of this, so it was the best test to try this on. Everything passed so we haven't changed structure of the TTNN generic op since the last update.

There are however improvements that can be made to generic op structure in terms of avoiding copying of objects, but since there was additional work to do in order to run PoC all the way through tt-mlir/tt-forge, we have continued working in that area, and deprioritized that and caching of the op as well
TT-MLIR work
Good starting point to understand the work done on generic op through tt-mlir (from top to bottom) is this comment
Related to this issue, we are going to track work done from TTNN dialect to the bottom (TTNN/metal). So far we have done

Serialization of the generic op from TTNN dialect to flatbuffer using --ttnn-to-flatbuffer pipeline. We have serialized general op info and input and output tensors

TTRT support for reading flatbuffer containing serialized information about generic op

TTRT support for preparing and packing data from flatbuffer to GenericOpDeviceOperation::operation_attributes_t, described in the previous comment on this issue

Topics to discuss
I think the implementation above helped us better understand what the general flow of running generic op is going to be, so I would like to add few topics we can discuss either in the issue or in the meeting

Can we support customer providing custom programs in order to calculate compile/runtime arguments? To me, it looks like the best place to do this is all the way up in tt-forge. Kristijan is working on creating the interface, through which customer could call generic op. I think we should just provide interface where you can pass numbers which are calculated somewhere before calling generic op

program.cpp is growing by every op. Generic op is going to have a lot of code required to even prepare actual call to TTNN, so maybe we need to have a way of doing this, either on op to op basis, or for all ops. Basically keep in program.cpp only actual calls to TTNN interface

We are building tt-mlir on ubuntu 22 and the latest supported image for tt-metal standalone build is ubuntu 20.4. This makes things a bit difficult if you want to fix something in Metal when you are in tt-mlir and maybe test it on it's own. Maybe there is the argument that we don't even want to do this, but it looks like trying to enable metal to build on ubuntu 22 could make our life easier when working in ttrt

TODOs
TODOs left in order to support running TTNN generic op from TTIR dialect

[ ] Serialize other attributes of generic op to flatbuffer (compute kernel attributes, circular buffer, data movement)
[ ] Add runtime arguments to generic op both in TTIR and TTNN dialect and serialize it to flatbuffer
[ ] Prepare runtime arguments from flatbuffer to structure required in GenericOpDeviceOperation::operation_attributes_t

At the moment it seems that all 3 task are just a matter of implementation, so we shouldn't have problems implementing it and running everything
These 3 tasks should complete running TTNN generic op from TTIR dialect. As @kmitrovicTT 's work is advancing as well, as described in the linked comment, we should be able to run it completely when we complete these tasks

We have completed 3 tasks from above so we can run everything from TTNN dialect all the way to TTNN. In order to run multiple tests with a lot of different runtime arguments it would be good to have python API for creating runtime arguments and generic op in general.
Support for runtime arguments is implemented in this commit. @kmitrovicTT let me know if you would like to change anything in the design of the runtime arguments that would make creating python API easier

authors: mbezuljTT nsmithtt pjanevskiTT

repo: tenstorrent/tt-mlir


text:
Add runTests

This function runs all tests for a crate inside Nix.

To be clear, though, I feel like this would be useful for many simpler crates and as long as the hook isn't run by default, I believe it would be a fine feature to add to the cargo2nix overlay.

I sense an acute lack of documentation. Hopefully, this tool won't end up as impenetrable as the rest of the nix ecosystem. I think it would be great if we can document any "patterns" or utilities we implement.

To clarify: I meant documentation to aid discoverability. One could argue that we "just" need to look under overlays/, but that's not what a new user would do.

@plumenator I agree! Got some time to help document it? :upside_down_face:

authors: ebkalderon plumenator trha workflow

license: MIT


text:
Fg/bayes calibracion

Segunda parte para bayesiana: calibración y regularización

Propuse unos cambios y encontre un bug en la simulacion de la normal-gamma-inversa. Revisado esto, propongo el merge.

authors: agarbuno felipegonzalez

repo: tereom/fundamentos


text:
Render customAttrs for Scatter.

Scatter.customAttrs was being ignored by Scatter.view.
The behavior of simply appending the customAttrs was a bit surprising as Svg.Attributes.style does not behave like Html.Attributes.style; In Svg the last style will override the others instead of being accumulated into a list of styles. I've included customAttrs last so that its style takes precedence, which was a bit confusing when it overrode Scatter.fill and Scatter.stroke since those get converted to style.

Hey! Sorry I didn't answer earlier for this - It shouldn't be a problem in the new api!

authors: chancyk terezka

repo: terezka/elm-plot


text:
Hi, can you make it runnable on cpu-only?

Hi,
I have a simple request to make the code runnable in cpu-only machine.
It is more testing the Python notebook.
Thank you.

Not sure if it's possible - might need to find equivalents for the in place abn functions that currently rely on CUDA...I'm interested in finding out the answer to this question too.

@billcai what do you mean by the ifs and is it just in the module/src/inplace_abn.cpp file that this is the case?

Removed this if else statement and just leave the cpu version for all the functions in inplace_abn.cpp
For example, from:
if (x.is_cuda()) {
return mean_var_cuda(x);
} else {
return mean_var_cpu(x);
}
To'
return mean_var_cpu(x):

Thanks a lot @billcai . Your input helped me after days of struggle on the same. One more important thing I had to do was comment out or delete the "inplace_abn_cuda.cu" in the functions .py script in the modules. Ultimately, then the TernausNetV2 was imported.


text:
TypeError: 'compression_opts' is an invalid keyword argument for this function(cache_train.py)

When I run your code -cache_train.py in spyder,it told that --TypeError: 'compression_opts' is an invalid keyword argument for this function(I have installed all packages what we need ),Can you tell me what should I do?
Thanks

You may try to remove argument compression_opts, it doesn't have any crucial meaning.

authors: cepera-ang yanghuiyun


text:
feat: add Stale Bot support

Description

Add Stale Bot Configuration
Motivation and Context

Allow for automatically marking stale issues and closing them.
I've set this only for tagging issues after 60 days at the moment, we can add closure and PRs later
Closes #13
Breaking Changes

No
How Has This Been Tested?

No

@antonbabenko, any repo we would like to test this with? i can configure the bot for it.

Please send such PR directly to notify-slack repo, where we can merge it and test it before rolling on all repos here.
Also, if your config is different from the one from the EKS module, let's try to make it the same. Or is it the same?

i see that its different, ill change it up and open PR for slack module

Done terraform-aws-modules/terraform-aws-notify-slack#77

Small mistake, moved the file to .github folder: terraform-aws-modules/terraform-aws-notify-slack#78

seems to be working nicely for the slack module, albeit you have to configure color of the label manually. we should change to yellow/red.

Yes, it works.
What do you think if we configure the stale bot to not touch PRs and only process issues? The reason for this is that there are some PRs which are pretty good and it is better to spend some efforts to finish them and merge (or close).
I have processed some PRs in several modules today but I don't have time to go through all of them (including yours) so do not hesitate to jump in and review/suggest/finish them.

That was the initial config but I changed it to align with EKS module, I
agree regarding PRs I'll remove the PR stale section.
On Mon, Apr 13, 2020, 12:58 Anton Babenko notifications@github.com wrote:

Yes, it works.
What do you think if we configure the stale bot to not touch PRs and only
process issues? The reason for this is that there are some PRs which are
pretty good and it is better to spend some efforts to finish them and merge
(or close).
I have processed some PRs in several modules today but I don't have time
to go through all of them (including yours) so do not hesitate to jump in
and review/suggest/finish them.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/terraform-aws-modules/meta/pull/14#issuecomment-612835995,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIA2W7SKH6MN76E4LHPZLBLRMLO5VANCNFSM4MGNHDMQ
.

added filter for issues only.

repo: terraform-aws-modules/meta


text:
Enable JS functions

Is your request related to a new offering from AWS?
Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.

Yes ✅: please list the AWS provider version which introduced this functionality

Is your request related to a problem?
Yes, the module currently does not support creating functions using the JS runtime.
Describe the solution you'd like.
Adjust this module to accept runtime and code parameters to be forwarded to the internal aws_appsync_function resources.
Describe alternatives you've considered.
Using VTL. Really a no-go from my perspective.
Additional context
JS support for resolvers was recently added. This would nicely complement that new functionality.
I would be happy to submit a PR.

https://github.com/terraform-aws-modules/terraform-aws-appsync/pull/49 :)

authors: GiampaoloFalqui juanoi


text:
Race condition for aws_iam_role_policy.tasks

Description
There appears to be a race condition (probably a depends_on required somewhere?) when I use tasks_iam_role_statements.
Versions

Module version [Required]: ~> 5.11
Terraform version: 1.8.3
Provider version(s): 1.8.3

Reproduction Code [Required]
module "example" {
  source  = "terraform-aws-modules/ecs/aws//modules/service"
  version = "~> 5.11"

  name                     = "example"
  cluster_arn              = module.example.cluster_arn
  desired_count            = 1
  cpu                      = 2048
  memory                   = 4096
  launch_type              = "FARGATE"
  requires_compatibilities = ["FARGATE"]
  subnet_ids               = module.vpc.private_subnets

  tasks_iam_role_statements = {
    ssm_get_parameter_kms = {
        effect = "Allow"

        actions = [
          "ssm:GetParameter",
          "kms:Decrypt"
        ]

        resources = ["*"]
      }
  }
...

Expected behavior
Order of creation should be:

module.example.aws_iam_role.tasks[0]
module.example.aws_iam_role_policy.tasks[0]
module.example.aws_ecs_task_definition.this[0]
module.example.aws_ecs_service.this[0]

Actual behavior
But order of creation became:

module.example.aws_iam_role.tasks[0]
module.example.aws_ecs_task_definition.this[0]
module.example.aws_ecs_service.this[0]
module.example.aws_iam_role_policy.tasks[0]

As a result, the ecs task actually started up before the policy was created.
Additional context
This is problematic for a service that I have in particular as it requires the ssm permissions to run the task successfully.

can you provide the full reproduction configuration? tasks_iam_role_statements are permissions added to the tasks IAM role - these are permissions used by your container at runtime. task_exec_iam_statements are permissions added to the task execution IAM role - these are permissions used to collect SSM parameter values and SecretsManager values when EC2 deploys your task

Hi @bryantbiggs , thank you for the reply.  I am aware of the difference between the task / task exec roles, in this case our service does not reference ssm values in the task definition, but rather in the application layer i.e. python boto3.
This was just an example to highlight the potential for a race condition where the task began running before policies are applied to the task role.

This issue has been resolved in version 5.11.2 :tada:

authors: antonbabenko bryantbiggs marqueurs404

repo: terraform-aws-modules/terraform-aws-ecs


text:
aws_db_instance listener endpoint

I can't see an option in the aws_db_instance code to extract the listener endpoint address.  This is an item created as part of a multi-az RDS for SQL Server.  Am I missing something?

if its not exposed by the AWS provider, then we cannot expose it here

The details can be obtained from the aws cli using describe-db-instance and the property ListenerEndpoint

you will need to file a feature request here https://github.com/hashicorp/terraform-provider-aws to get this added to the provider first before we can support it here

repo: terraform-aws-modules/terraform-aws-rds