Categories
Misc

I am new to tensorflow, and I am confused abt this section of the code. Can someone briefly explain this to me, I appreciate it.

plt.figure(figsize=(10,10)) 

for i in range(25): plt.subplot(5,5,i+1) plt.xticks([])
plt.yticks([]) plt.grid(False) plt.imshow(train_images[i],
cmap=plt.cm.binary) plt.xlabel(class_names[train_labels[i]])
plt.show()

submitted by /u/Real_Scholar2762

[visit reddit]

[comments]

Categories
Misc

Pass empty directory to tf.train.get_checkpoint_state()

Hello, I’m completely new to tensorflow. Right now I’m trying
out a
training script
on two different datasets using tensorflow
1.13.0, and got stuck when it was trying to pass an empty directory
PRETRAINED_MODEL_PATH to
tf.train.get_checkpoint_state(PRETRAINED_MODEL_PATH),

PRETRAINED_MODEL_PATH = '' saver = tf.train.Saver([v for v in tf.get_collection_ref(tf.GraphKeys.GLOBAL_VARIABLES) if('lr' not in v.name) and ('batch' not in v.name)]) ckptstate = tf.train.get_checkpoint_state(PRETRAINED_MODEL_PATH) 

The two datasets are getting two different responses when
passing an empty directory to tf.train.get_checkpoint_state(). The
first dataset I tried outputs a warning, but the training
continues.

WARNING:tensorflow:FailedPreconditionError: checkpoint; Is a directory WARNING:tensorflow:checkpoint: Checkpoint ignored 

The second dataset I tried outputs an error and script ends.

Traceback (most recent call last): File "cam_est/train_sdf_cam.py", line 827, in <module> train() File "cam_est/train_sdf_cam.py", line 495, in train ckptstate = tf.train.get_checkpoint_state(PRETRAINED_MODEL_PATH) File "/home/jg/anaconda3/envs/tf_trimesh/lib/python3.6/site-packages/tensorflow/python/training/checkpoint_management.py", line 278, in get_checkpoint_state + checkpoint_dir) ValueError: Invalid checkpoint state loaded from 

I have tried everything I can think of but still can’t figure
out the problem. Can someone help please?

submitted by /u/HistoricalTouch0

[visit reddit]

[comments]

Categories
Misc

"Unhandled Rejection Error, The Implicit Shape can not be a fractional number "


"Unhandled Rejection Error, The Implicit Shape can not be a fractional number "

Hello everyone, sos

I am following an online tutorial on how to run gesture
recognition using react and tensor flow. However, I am always
seeing this error whenever I play around with the webcam in
chrome.

Here is my github for what I am working on btw. And here is the
tutorial video I’m watching. I got stuck right around minute 10

https://github.com/riccrdo5/help

https://youtu.be/f7uBsb-0sGQ

Ty and happy holidays


https://preview.redd.it/3y923uvvc6961.png?width=1366&format=png&auto=webp&s=557aed6e1faac7e38150189582dba9796f4a044c


https://preview.redd.it/ateyqtvvc6961.jpg?width=960&format=pjpg&auto=webp&s=ffed821126f1e56f9d2ae1b9562e37a2de85f7a4

submitted by /u/RicardoCarlos55

[visit reddit]

[comments]

Categories
Misc

ValueError: Negative dimension size caused by subtracting 2 from 1

def get_model_2(input_shape): model = Sequential() model.add(Conv2D(64, (5, 5), activation='relu', input_shape=input_shape)) model.add(MaxPooling2D(pool_size=(3, 3))) model.add(Conv2D(128, (4, 4), activation='relu')) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Conv2D(512, (3, 3), activation='relu')) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Conv2D(512, (3, 3), activation='relu')) model.add(MaxPooling2D(pool_size=(2, 2))) # model.add(Conv2D(512, (3, 3), activation='relu')) # model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Conv2D(512, (2, 2), activation='relu')) model.add(MaxPooling2D(pool_size=(2, 2))) model.add(Flatten()) model.add(Dense(512, activation='relu')) # model.add(Dropout(0.5)) model.add(Dense(1, activation='sigmoid')) return model 

Why do I get the following error when I un-comment that middle
layer?

ValueError: Negative dimension size caused by subtracting 2 from
1 for ‘{{node max_pooling2d_4/MaxPool}} = MaxPool[T=DT_FLOAT,
data_format=”NHWC”, explicit_paddings=[], ksize=[1, 2, 2, 1],
padding=”VALID”, strides=[1, 2, 2, 1]](Placeholder)’ with input
shapes: [?,1,1,512].

submitted by /u/BananaCharmer

[visit reddit]

[comments]

Categories
Misc

Trained a model w. Keras in Python w. custom loss function. How can I deploy it for inference with Tensorflow Serving – aka how to define a custom loss function or just disable that part?

I wrote a custom model using a custom loss function. The layers
are all basic keras layers but the loss function is a custom. How
do I move this to a high performance serving scenario? I don’t need
to do training – just prediction. Suggestions? Tutorials?

submitted by /u/i8code

[visit reddit]

[comments]

Categories
Misc

YOLOv4 Face Recognition on Custom Dataset


YOLOv4 Face Recognition on Custom Dataset
submitted by /u/TheCodingBug

[visit reddit]

[comments]
Categories
Misc

How to fix VQ-VAE postirior collapse?

Im Training a vq-vae on audio data (spectrograms), but the
posterior always collapses. Anyone an idea how to avoid that?

submitted by /u/Ramox_Phersu

[visit reddit]

[comments]

Categories
Misc

Export a model for inference.

Hi, All,

I have written a script to export a pre-trained TensorFlow model
for inference. The inference code is for the code present at this
directory –https://github.com/sabarim/itis.

I took a reference from the Deeplab export_model.py script to
write a similar one for this model.

Reference script link:
https://github.com/tensorflow/models/blob/master/research/deeplab/export_model.py

My script:

https://projectcode1.s3-us-west-1.amazonaws.com/export_model.py

I am getting an error, when I try to run inference from the
saved model.

FailedPreconditionError: 2 root error(s) found.

(0) Failed precondition: Attempting to use uninitialized value
decoder/feature_projection0/BatchNorm/moving_variance [[{{node
decoder/feature_projection0/BatchNorm/moving_variance/read}}]]
[[SemanticPredictions/_13]] (1) Failed precondition: Attempting to
use uninitialized value
decoder/feature_projection0/BatchNorm/moving_variance [[{{node
decoder/feature_projection0/BatchNorm/moving_variance/read}}]] 0
successful operations. 0 derived errors ignored.

Could anyone please take a look and help me understand the
problem.

submitted by /u/DamanpKaur

[visit reddit]

[comments]

Categories
Misc

Tensorflow on ARM Devices

Hey everyone,

I’m using a Surface Pro X and wanted to get a little bit into
Deep Learning and neural networks, and wanted to use Tensorflow. Is
it possible/How is it possible to install Tensorflow on ARM
devices? Seems to me like the first big hurdle is the one that I
can’t install Python as a 64-bit-version. Should I maybe use an
emulation? Thanks for any help!

submitted by /u/Hot-Ad-3651

[visit reddit]

[comments]

Categories
Misc

Tensorboard: Should I be using the smoothed or normal value for evaluating accuracy?

Hi Everyone,

Pretty much in the title. I’m pretty sure that the smoothed
values are some sort of exponential moving average.

When evaluating the accuracy of the model (say, the accuracy I
want to tell people my model can achieve on the validation set, for
some nth epoch), should I be using the smoothed value or the normal
value? I take the accuracy every epoch.

Of course, this is before the ultimate test on the test set, but
before doing that, to kind of figure out what my max accuracy is,
and to gauge if the hyperparamaters i’m choosing are working,
should I be going by the smoothed or not smoothed values?

An example:

On step no. 151 (epoch 8)

smoothed accuracy (with smooth = 0.6) is 36.25%

“real” accuracy is 42.86%

Is my actual accuracy 36.25% or 42.86%? i

Thanks!

A

submitted by /u/kirbyburgers

[visit reddit]

[comments]