Occurrence and resolution of tensorflow.python.framework.errors_impl.FailedPreconditionError

Overview

I stumbled upon a tensorflow error when doing a simple GAN in Keras, so a reminder of that

What I wanted to do

--Try moving the GAN sample code ――I used it as a reference Here

error contents

tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable _AnonymousVar44 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar44/class tensorflow::Var does not exist. [[node mul_28/ReadVariableOp (defined at C:\Python\envs\virtualenv001\lib\site-packages\keras\backend\tensorflow_backend.py:3009) ]] [Op:__inference_keras_scratch_graph_2136]

Function call stack: keras_scratch_graph

Reason

It seems that the variable initialization error of tensorflow (Reference)) I wasn't sure which variable was causing the initialization error, but I found a solution here here

Countermeasures

--optimer uses tensorflow instead of keras. (from tensorflow.keras.optimizers import Adam)

If anyone knows the cause of the error, I would appreciate it if you could comment.

Recommended Posts

Occurrence and resolution of tensorflow.python.framework.errors_impl.FailedPreconditionError
Problems of liars and honesty
Mechanism of pyenv and virtualenv
Combination of recursion and generator
Explanation and implementation of SocialFoceModel
Differentiation of sort and generalization of sort
Coexistence of pyenv and autojump
Use and integration of "Shodan"
Problems of liars and honesty
Comparison of Apex and Lamvery
Source installation and installation of Python
Introduction and tips of mlflow.Tracking
Environment construction of python and opencv
Various of Tweepy. Ma ♡ and ♡ me ♡
Basic knowledge of Linux and basic commands
Order of arguments of RegularGridInterpolator and interp2d
The story of Python and the story of NaN
Explanation and implementation of PRML Chapter 4
Introduction and Implementation of JoCoR-Loss (CVPR2020)
Benefits and examples of using RabbitMq
Explanation and implementation of ESIM algorithm
Danger of mixing! ndarray and matrix
Installation of SciPy and matplotlib (Python)
Significance of machine learning and mini-batch learning
Introduction and implementation of activation function
Misunderstandings and interpretations of Luigi's dependencies
Explanation and implementation of simple perceptron
Calculation of homebrew class and existing class
This and that of python properties
Design of experiments and combinatorial optimization
Installation and easy usage of pytest
Features of symbolic and hard links
Coexistence of Python2 and 3 with CircleCI (1.0)
Summary of Python indexes and slices
Aggregation and visualization of accumulated numbers
Reputation of Python books and reference books
Data cleansing of open data of the occurrence situation of the Ministry of Health, Labor and Welfare