I created a modified lenet model using tensorflow that looks like this: When I finish training I save the model using tf.keras.models.save_model : Then I transform this model into onnx format using “tf2onnx” module: I want a method that can retrieve the same model into tensorflow2.x. I tried to use “onnx_tf” to transform the onnx model into tensorflow .pb model:
Tag: tensorflow
(Tensorflow) Stuck at Epoch 1 during model.fit()
I’ve been trying to make Tensorflow 2.8.0 work with my Windows GPU (GeForce GTX 1650 Ti), and even though it detects my GPU, any model that I make will be stuck at Epoch 1 indefinitely when I try to use the fit method till the kernel (I’ve tried on jupyter notebook and spyder) hangs and restarts. Based on Tensorflow’s website,
How to find contours in dotted text captcha image
I am newbie to OpenCV. I’m trying to find the contours of the captcha image. It does not work only when my captcha image contains the dotted text. I have done following code for that: Can anyone help in this? Is there any way to find contours in this image? Answer Here is my code and output
How to draw the precision-recall curve for a segmentation model?
I am using an U-Net for segmenting my data of interest. The masks are grayscale and of size (256,256,1). There are 80 images in the test set. The test images (X_ts) and their respective ground-truth masks (Y_ts) are constructed, saved, and loaded like this: The shape of Y_ts (ground truth) is therefore (80,256,256,1) and these are of type “Array of
How can i sum up multiple inputs in one when using a submodel?
I wrote a custom Tree-RNN-CELL that can handle several different inputs when they are provided as a tuple. This is working fine, but now I wanted to put it together in a submodel, so that i can sum the 4 lines up in 2 lines and to have a better overview ( the tree gets big so its worth it)
TensorFlow (any version > 2.5.0) on M1 Mac: No code completion in PyCharm
I am using JetBrain’s PyCharm IDE to work with TensorFlow on a M1 Mac machine. I have installed TensorFlow using the following commands in the given order: For installing Conda, I followed Apple’s official documentation I can import TensorFlow without problems; the version number it prints is 2.8.0. However, I am not getting any code completion suggestions. When typing tensorflow.keras.l,
Extracting first-layer weights from a multi-layer Keras NN and transferring them to a single layer NN
I trained a 3-hidden layer NN (3-HL) using Keras (with good results, and I wanted to extract the weights from its first layer (inputs to its first-hidden layer) and use them in a single-hidden layer NN (inputs to its single hidden layer), to train. The 3-HL model summary along with its extracted (hopefully first layer) weight dimensions is as follows:
How to run scipy’s BFGS on GPU
I’d like to run scipy implementation of BFGS optimization algorithm on GPU and scipy seems not to support GPUs. The target function which I want to run on GPU is the following one which is part of the implementation of this repository: I know there is Tensorflow Probablity implementation of BFGS, but I couldn’t find out how I can convert
Incomparable weight shape between caffe and tensorflow / keras
I am trying to convert a caffe model to keras, I have successfully been able to use both MMdnn and even caffe-tensorflow. The output I have are .npy files and .pb files. I have not had much luck with the .pb files, so I stuck to .npy files which contain the weights and biases. I have reconstructed an mAlexNet network
what does cardinality mean in relation to an image dataset?
After successfully creating a tensorflow image Dataset with: dataset = tf.keras.utils.image_dataset_from_directory(…) which returns Found 21397 files belonging to 5 classes. Using 17118 files for training. There is the cardinality method: dataset.cardinality() which returns a tensor containing the single value tf.Tensor(535, shape=(), dtype=int64) I’ve read the docs here but I don’t understand what 535 represents or why its different to the