Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FailedPreconditionError #5

Open
BraveDistribution opened this issue Sep 10, 2019 · 0 comments
Open

FailedPreconditionError #5

BraveDistribution opened this issue Sep 10, 2019 · 0 comments

Comments

@BraveDistribution
Copy link

Loading model image and using any of the methods returns FailedPreconditionError.

FailedPreconditionError: 2 root error(s) found.
  (0) Failed precondition: Error while reading resource variable block5_conv1_2/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/block5_conv1_2/kernel)
	 [[{{node model_2/block5_conv1/Conv2D/ReadVariableOp}}]]
	 [[gradients/model_2/block1_conv1/Conv2D_grad/Conv2DBackpropInput/_11]]
  (1) Failed precondition: Error while reading resource variable block5_conv1_2/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/block5_conv1_2/kernel)
	 [[{{node model_2/block5_conv1/Conv2D/ReadVariableOp}}]]

My code:

model = load_model(os.getcwd() + "/models/saved_models_for_fusion/0_FusionVGGMnistToPS.h5")
img_path = str(Path(os.getcwd() + "/models/scripts/xxx.jpg"))
img = load_img(img_path)
explainer = Saliency(model, layer=3)
exp = explainer.explain(img, 0)

I think that the resolution can be found here:
tensorflow/tensorflow#28287 (comment) is it possible to check whether this can fix this issue? It seems that loading model and using model.predict() fails due to not thread-safe operations.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant