tensorflow

Disable augmentation in tensorflow training pipeline

怎甘沉沦 提交于 2021-01-27 21:01:38
问题 I googled around a bit but I only found questions about enabling data augmentation. I followed this tutorial but with my own dataset (only one class). I already performed data augmentation on my dataset so I deleted the responsible lines from the pipeline.config. Now my pipeline looks like this model { ssd { num_classes: 1 image_resizer { fixed_shape_resizer { height: 640 width: 640 } } feature_extractor { type: "ssd_resnet50_v1_fpn_keras" depth_multiplier: 1.0 min_depth: 16 conv_hyperparams

Tensorflow - ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed

混江龙づ霸主 提交于 2021-01-27 20:57:29
问题 I am struggling to utilise TensorFlow within Jupyter notebook. I have installed TensorFlow via Anaconda Prompt (running as admin). But when I go to call it in my notebook I get the following error string (sorry this is long). Any help or thoughts would be welcomed here - should I run a full uninstall and try again? kind regards Jack I am running: from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense The error message is as follows (there are a number of

Average layer in multi input deep learning

不想你离开。 提交于 2021-01-27 20:35:51
问题 I am working to create a multi-input Convolutional Neural Network (CNN) model in Keras for Images Classification that takes two images and gives one output which is the class of the two images. I have two datasets: type1 and type2, and each dataset contains the same classes. The model should take one image from Type1 dataset and one image from Type2 dataset and then classify these images to one class (ClassA or ClassB or------). I want to create a model that predict the two images and then

tensorflow error utf-8 OS X Sierra

╄→гoц情女王★ 提交于 2021-01-27 20:35:24
问题 I've installed TensorFlow with Anaconda on OS X Sierra. I didn't´t have any problems during installation. Writing the tipical example: import tensorflow as tf a = tf.constant(5, name="input_a") b = tf.constant(3, name="input_b") c = tf.mul(a, b, name="mul_c") d = tf.add(a, b, name="add_d") e = tf.add(c, d, name="add_e") sess = tf.Session() output = sess.run(e) writer = tf.summary.FileWriter('./my_graph', sess.graph) writer.close() sess.close() The file is created in the appropriate folder,

Determining max batch size with TensorFlow Object Detection API

孤街浪徒 提交于 2021-01-27 19:54:46
问题 TF Object Detection API grabs all GPU memory by default, so it's difficult to tell how much I can further increase my batch size. Typically I just continue to increase it until I get a CUDA OOM error. PyTorch on the other hand doesn't grab all GPU memory by default, so it's easy to see what percentage I have left to work with, without all the trial and error. Is there a better way to determine batch size with the TF Object Detection API that I'm missing? Something like an allow-growth flag

Can't convert Core ML model to Onnx (then to Tensorflow Lite)

帅比萌擦擦* 提交于 2021-01-27 19:51:26
问题 I'm trying to convert a trained Core ML model to TensorFlow Lite. I find I need convert it to Onnx first. The problems is that I get errors. I've tried with different versions of python, onnxmltools, winmltools and it doesn't seems to work. I also tried docker image of onnx ecosystem with same result. Can any one help me with it? Thanks in advance. Script I used: import coremltools import onnxmltools input_coreml_model = '../model.mlmodel' output_onnx_model = '../model.onnx' coreml_model =

tf_agents custom time_step_spec

a 夏天 提交于 2021-01-27 19:10:31
问题 I'm tinkering with tf-agents but I'm having trouble making a custom time_step_spec . I'm trying to train a tf-agent in gym 'Breakout-v0', I've made a function to preprocess the observation (game pixels) and now I want to modify the time_step and time_step_spec to reflect the new data. original time_step_spec.observation() is: BoundedTensorSpec(shape=(210, 160, 3), dtype=tf.uint8, name='observation', minimum=array(0, dtype=uint8), maximum=array(255, dtype=uint8)) mine would be:

Tensorflow 2.3: AttributeError: 'Tensor' object has no attribute 'numpy'

醉酒当歌 提交于 2021-01-27 19:09:40
问题 I wanted to load the text file borrowed from here, where each line represent a json string like following: {"overall": 2.0, "verified": true, "reviewTime": "02 4, 2014", "reviewerID": "A1M117A53LEI8", "asin": "7508492919", "reviewerName": "Sharon Williams", "reviewText": "DON'T CARE FOR IT. GAVE IT AS A GIFT AND THEY WERE OKAY WITH IT. JUST NOT WHAT I EXPECTED.", "summary": "CASE", "unixReviewTime": 1391472000} I would like to extract only reviewText and overall feature from the dataset using

Find rank of a sub-matrix in Tensorflow

a 夏天 提交于 2021-01-27 19:07:03
问题 I have a matrix g of shape [4, 4, 2, 2] where I need to find the rank of g[0, 0] , g[1, 1] , g[2, 2] and g[3, 3] which are all 2x2 matrices. I used the tf.rank operator but it treats g as a single array and computes the rank and returns a single value for the whole matrix. What I need is a 2x2 matrix of ranks of the corresponding g[i, j] 's. Following is a MWE: import tensorflow as tf import numpy as np a = np.array([ [[[ 0., 0.], [ 0., 0.]], [[-1., -1.], [-1., -1.]], [[-2., -2.], [-2., -2.]]

convert tensorflow model to pb tensorflow

▼魔方 西西 提交于 2021-01-27 19:02:02
问题 I have a pretrained model that I need to convert to pb. I have following file in the folder: bert_config.json model.ckpt-1000data model.ckpt-10000.index model.ckpt-1000.meta vocab.txt How can I convert this to pb format? Thanks 回答1: You can freeze the model: TensorFlow: How to freeze a model and serve it with a python API import os, argparse import tensorflow as tf # The original freeze_graph function # from tensorflow.python.tools.freeze_graph import freeze_graph dir = os.path.dirname(os