tensorflow2.0

What types of operations will/will not plugin the computational graph in the Tensorflow 2?

五迷三道 提交于 2021-01-05 07:21:13
问题 Based on this post, we can change the tf.variable threshold = 3 a = np.array([1,2,3,4,5,6]) b = tf.Variable(a) b = tf.where(b >= threshold, 199, b) Will b=tf.where(b>=3, 199, b) be plugin to the computational graph and affect the gradient of b in the back propragration? Or more general questions: What types of operations will/will not plugin the computational graph in the Tensorflow 2 ? 来源: https://stackoverflow.com/questions/65449945/what-types-of-operations-will-will-not-plugin-the

Tensorboard checkpoint : Access is denied. ; Input/output error

别说谁变了你拦得住时间么 提交于 2021-01-05 07:20:46
问题 I am trying to create a tensor board in Jupyter anaconda the following way. The error occurs when write_images = True , otherwise, this code works fine. Any reason why this happens? log_dir="logs\\fit\\" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S") tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, histogram_freq=1, write_graph = True, write_images = False update_freq = 'epoch' profile_batch = 3, embeddings_freq=1 ) And I get UnknownError: Failed to rename: logs

Tensorflow object_detection API fine tune ckpt classification

早过忘川 提交于 2021-01-04 06:36:56
问题 I am just wondering what is the difference between the "classification" and "detection" fine tuning types for the available checkpoints in the object detection API. Are they both eligible to train novel classes? The checkpoints obtained from such training, can be further trained with the very same pipeline.config, or does it need to have a different fine tuning type? EDIT to make the question clearer, one can take as reference the ckpts mentioned in https://github.com/tensorflow/models/blob

Tensorflow object_detection API fine tune ckpt classification

青春壹個敷衍的年華 提交于 2021-01-04 06:36:14
问题 I am just wondering what is the difference between the "classification" and "detection" fine tuning types for the available checkpoints in the object detection API. Are they both eligible to train novel classes? The checkpoints obtained from such training, can be further trained with the very same pipeline.config, or does it need to have a different fine tuning type? EDIT to make the question clearer, one can take as reference the ckpts mentioned in https://github.com/tensorflow/models/blob

Why is Tensorflow's Gradient Tape returning None when trying to find the gradient of loss wrt input?

拜拜、爱过 提交于 2021-01-01 09:28:50
问题 I have a CNN model built in keras which uses an SVM in its last layer. I get the prediction of this SVM by putting in an input into the CNN model, extracting the relevant features and then putting those features into my SVM to get an output prediction. This entire process I have names predict_DNR_tensor in the code below. This works fine and I am able to get a correct prediction. I am now trying to get a gradient of squared hinge loss of this prediction from my SVM wrt to the original input,

Can tf.agent policy return probability vector for all actions?

倾然丶 夕夏残阳落幕 提交于 2020-12-31 07:44:45
问题 I am trying to train a Reinforcement Learning agent using TF-Agent TF-Agent DQN Tutorial. In my application, I have 1 action containing 9 possible discrete values (labeled from 0 to 8). Below is the output from env.action_spec() BoundedTensorSpec(shape=(), dtype=tf.int64, name='action', minimum=array(0, dtype=int64), maximum=array(8, dtype=int64)) I would like to get the probability vector contains all actions calculated by the trained policy, and do further processing in other application

Can tf.agent policy return probability vector for all actions?

爷,独闯天下 提交于 2020-12-31 07:37:32
问题 I am trying to train a Reinforcement Learning agent using TF-Agent TF-Agent DQN Tutorial. In my application, I have 1 action containing 9 possible discrete values (labeled from 0 to 8). Below is the output from env.action_spec() BoundedTensorSpec(shape=(), dtype=tf.int64, name='action', minimum=array(0, dtype=int64), maximum=array(8, dtype=int64)) I would like to get the probability vector contains all actions calculated by the trained policy, and do further processing in other application

TensorFlow v2: Replacement for tf.contrib.predictor.from_saved_model

∥☆過路亽.° 提交于 2020-12-31 04:59:02
问题 So far, I was using tf.contrib.predictor.from_saved_model to load a SavedModel ( tf.estimator model class). However, this function has unfortunately been removed in TensorFlow v2. So far, in TensorFlow v1, my coding was the following: predict_fn = predictor.from_saved_model(model_dir + '/' + model, signature_def_key='predict') prediction_feed_dict = dict() for key in predict_fn._feed_tensors.keys(): #forec_data is a DataFrame holding the data to be fed in for index in forec_data.index:

TensorFlow v2: Replacement for tf.contrib.predictor.from_saved_model

允我心安 提交于 2020-12-31 04:57:18
问题 So far, I was using tf.contrib.predictor.from_saved_model to load a SavedModel ( tf.estimator model class). However, this function has unfortunately been removed in TensorFlow v2. So far, in TensorFlow v1, my coding was the following: predict_fn = predictor.from_saved_model(model_dir + '/' + model, signature_def_key='predict') prediction_feed_dict = dict() for key in predict_fn._feed_tensors.keys(): #forec_data is a DataFrame holding the data to be fed in for index in forec_data.index:

TensorFlow v2: Replacement for tf.contrib.predictor.from_saved_model

℡╲_俬逩灬. 提交于 2020-12-31 04:56:47
问题 So far, I was using tf.contrib.predictor.from_saved_model to load a SavedModel ( tf.estimator model class). However, this function has unfortunately been removed in TensorFlow v2. So far, in TensorFlow v1, my coding was the following: predict_fn = predictor.from_saved_model(model_dir + '/' + model, signature_def_key='predict') prediction_feed_dict = dict() for key in predict_fn._feed_tensors.keys(): #forec_data is a DataFrame holding the data to be fed in for index in forec_data.index: