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

UnboundLocalError: local variable 'a' referenced before assignment #23410

Open
theeheng opened this issue Oct 31, 2018 · 28 comments

Comments

Projects
None yet
@theeheng
Copy link

commented Oct 31, 2018

hi there, i have install phyton 3.7 with the following build : v1.11.0-rc2-4-gc19e29306c 1.11.0

here the phyton sample code:

keras_file = "keras_model.h5"
tf.keras.models.save_model(model, keras_file)

Convert to TensorFlow Lite model.

converter = tf.contrib.lite.TocoConverter.from_keras_model_file(keras_file)
tflite_model = converter.convert()
open("converted_model.tflite", "wb").write(tflite_model)

when it try to execute : converter = tf.contrib.lite.TocoConverter.from_keras_model_file(keras_file)

and throw the following error:

converter = tf.contrib.lite.TocoConverter.from_keras_model_file(keras_file)
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/contrib/lite/python/lite.py", line 354, in from_keras_model_file
_keras.backend.clear_session()
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/python/keras/backend.py", line 335, in clear_session
False, shape=(), name='keras_learning_phase')
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 5148, in placeholder_with_default
"PlaceholderWithDefault", input=input, shape=shape, name=name)
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
preferred_dtype=default_dtype)
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1144, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 228, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 207, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/Users/htan/venv/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py", line 542, in make_tensor_proto
append_fn(tensor_proto, proto_values)
File "tensorflow/python/framework/fast_tensor_util.pyx", line 134, in tensorflow.python.framework.fast_tensor_util.AppendBoolArrayToTensorProto
File "/Users/htan/venv/lib/python3.7/site-packages/numpy/lib/type_check.py", line 489, in asscalar
return a.item()
UnboundLocalError: local variable 'a' referenced before assignment

@iconnor

This comment has been minimized.

Copy link

commented Nov 21, 2018

I get the same error on OSX with v1.12.0 but if I run it via docker it does not have the error. I also avoid the error by not doing a dropout.
Causes error:

model = Sequential()
model.add(Dense(500, input_shape = (TRAIN_SIZE, )))
model.add(Activation('relu'))
model.add(Dropout(0.25))
model.add(Dense(250))

Compiles without error:

model = Sequential()
model.add(Dense(500, input_shape = (TRAIN_SIZE, )))
model.add(Activation('relu'))
#model.add(Dropout(0.25))
model.add(Dense(250))
@msmsajjadi

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2018

I'd like to chime in that I've also been getting this error since upgrading to Python 3.7 (from Python 3.6) on OSX, unrelated to Keras. Replacing the call to tf.placeholder_with_default with tf.placeholder has fixed it for me.

Update: #23410 (comment)

@kirthika-m

This comment has been minimized.

Copy link

commented Nov 28, 2018

I keep getting this error too, but while running object detection training using model_main.py. I also get a very similar error when training using legacy/train.py. Here is my error:

Traceback (most recent call last):
File "object_detection/model_main.py", line 109, in
tf.app.run()
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "object_detection/model_main.py", line 105, in main
tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/training.py", line 471, in train_and_evaluate
return executor.run()
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/training.py", line 610, in run
return self.run_local()
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/training.py", line 711, in run_local
saving_listeners=saving_listeners)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py", line 354, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py", line 1207, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py", line 1234, in _train_model_default
input_fn, model_fn_lib.ModeKeys.TRAIN))
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py", line 1075, in _get_features_and_labels_from_input_fn
self._call_input_fn(input_fn, mode))
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py", line 1162, in _call_input_fn
return input_fn(**kwargs)
File "/Users/Kirthika/Documents/gitroot/Libraries-ObjectDetection/models/research/object_detection/inputs.py", line 479, in _train_input_fn
batch_size=params['batch_size'] if params else train_config.batch_size)
File "/Users/Kirthika/Documents/gitroot/Libraries-ObjectDetection/models/research/object_detection/builders/dataset_builder.py", line 134, in build
config.input_path[:], input_reader_config)
File "/Users/Kirthika/Documents/gitroot/Libraries-ObjectDetection/models/research/object_detection/builders/dataset_builder.py", line 80, in read_dataset
sloppy=config.shuffle))
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 1190, in apply
dataset = transformation_func(self)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/data/experimental/ops/interleave_ops.py", line 87, in _apply_fn
buffer_output_elements, prefetch_input_elements)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/data/ops/readers.py", line 136, in init
sloppy, dtype=dtypes.bool, name="sloppy")
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1050, in convert_to_tensor
as_ref=False)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1146, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 229, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 208, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py", line 542, in make_tensor_proto
append_fn(tensor_proto, proto_values)
File "tensorflow/python/framework/fast_tensor_util.pyx", line 134, in tensorflow.python.framework.fast_tensor_util.AppendBoolArrayToTensorProto
File "/Users/Kirthika/Documents/gitroot/MODvenv/lib/python3.7/site-packages/numpy/lib/type_check.py", line 489, in asscalar
return a.item()
UnboundLocalError: local variable 'a' referenced before assignment

I haven't been able to solve it and any recommendations are welcome.

@callensm

This comment has been minimized.

Copy link

commented Nov 30, 2018

I'm also getting this error on OSX with TF 1.12 and Python 3.7 anytime I use the a seemingly random set of Keras layers.

Seems to throw the error when using Keras' Dropout and BatchNormalization layers for me.

@bpraveenk

This comment has been minimized.

Copy link

commented Dec 3, 2018

Facing similar issue on Mac-10.12.6, python-3.7

Partial stack-trace
File "/Users/pbodigut/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 217, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/Users/pbodigut/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 196, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/Users/pbodigut/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py", line 536, in make_tensor_proto
append_fn(tensor_proto, proto_values)
File "tensorflow/python/framework/fast_tensor_util.pyx", line 127, in tensorflow.python.framework.fast_tensor_util.AppendBoolArrayToTensorProto
File "/Users/pbodigut/anaconda3/lib/python3.7/site-packages/numpy/lib/type_check.py", line 489, in asscalar
return a.item()

@jimil24111990

This comment has been minimized.

Copy link

commented Dec 10, 2018

Any updates on this? I am facing the same issue.

@noahpicard

This comment has been minimized.

Copy link

commented Dec 12, 2018

Uninstalling Python 3.7 and installing Python 3.6 fixed it for me.

@msmsajjadi

This comment has been minimized.

Copy link
Contributor

commented Dec 16, 2018

I'd like to chime in that I've also been getting this error since upgrading to Python 3.7 (from Python 3.6) on OSX, unrelated to Keras. Replacing the call to tf.placeholder_with_default with tf.placeholder has fixed it for me.

Following up on this, I've noticed that the bug is caused anytime I try to create a tf.variable or tf.placeholder of type tf.bool. Hope this helps in fixing this issue.

@titocosta

This comment has been minimized.

Copy link

commented Dec 22, 2018

MacOs and Python 3.7 gives the same error when running python census_main.py to train the official wide and deep model.

@TeaPearce

This comment has been minimized.

Copy link

commented Jan 3, 2019

I'd like to chime in that I've also been getting this error since upgrading to Python 3.7 (from Python 3.6) on OSX, unrelated to Keras. Replacing the call to tf.placeholder_with_default with tf.placeholder has fixed it for me.

any chance you could expand on this? I tried changing the call to PlaceholderWithDefault in gen_array_ops.py line 5334 but it just triggered another error.

@echarso

This comment has been minimized.

Copy link

commented Jan 3, 2019

Same problem here

@msmsajjadi

This comment has been minimized.

Copy link
Contributor

commented Jan 6, 2019

I'd like to chime in that I've also been getting this error since upgrading to Python 3.7 (from Python 3.6) on OSX, unrelated to Keras. Replacing the call to tf.placeholder_with_default with tf.placeholder has fixed it for me.

any chance you could expand on this? I tried changing the call to PlaceholderWithDefault in gen_array_ops.py line 5334 but it just triggered another error.

The bug had nothing to do with the placeholders, it occurs whenever I try to create anything of type tf.bool. Changing tf.placeholder_with_default to tf.placeholder had fixed the bug for me because the default value was a tf.bool :)

See update here: #23410 (comment)

@msmsajjadi

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2019

@theeheng You might want to change the labels (if you can) as this issue seems to be unrelated to Keras and directly related to booleans.

Here's some minimal examples to get the error:

import tensorflow as tf
tf.Variable(True)
import tensorflow as tf
tf.get_variable('test_bool', 1, tf.bool)
@eternalPangaea

This comment has been minimized.

Copy link

commented Jan 19, 2019


UnboundLocalError Traceback (most recent call last)
in
6 training_targets=training_targets,
7 validation_examples=validation_examples,
----> 8 validation_targets=validation_targets)

in train_linear_classifier_model(learning_rate, steps, batch_size, training_examples, training_targets, validation_examples, validation_targets)
42 linear_classifier.train(
43 input_fn=training_input_fn,
---> 44 steps=steps_per_period
45 )
46 # Take a break and compute predictions.

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py in train(self, input_fn, hooks, steps, max_steps, saving_listeners)
352
353 saving_listeners = _check_listeners_type(saving_listeners)
--> 354 loss = self._train_model(input_fn, hooks, saving_listeners)
355 logging.info('Loss for final step: %s.', loss)
356 return self

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py in _train_model(self, input_fn, hooks, saving_listeners)
1205 return self._train_model_distributed(input_fn, hooks, saving_listeners)
1206 else:
-> 1207 return self._train_model_default(input_fn, hooks, saving_listeners)
1208
1209 def _train_model_default(self, input_fn, hooks, saving_listeners):

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py in _train_model_default(self, input_fn, hooks, saving_listeners)
1232 features, labels, input_hooks = (
1233 self._get_features_and_labels_from_input_fn(
-> 1234 input_fn, model_fn_lib.ModeKeys.TRAIN))
1235 worker_hooks.extend(input_hooks)
1236 estimator_spec = self._call_model_fn(

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py in _get_features_and_labels_from_input_fn(self, input_fn, mode)
1073 """Extracts the features and labels from return values of input_fn."""
1074 return estimator_util.parse_input_fn_result(
-> 1075 self._call_input_fn(input_fn, mode))
1076
1077 def _extract_batch_length(self, preds_evaluated):

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/estimator/estimator.py in _call_input_fn(self, input_fn, mode)
1160 kwargs['config'] = self.config
1161 with ops.device('/cpu:0'):
-> 1162 return input_fn(**kwargs)
1163
1164 def _call_model_fn(self, features, labels, mode, config):

in ()
22 training_input_fn = lambda: my_input_fn(training_examples,
23 training_targets["Survived"],
---> 24 batch_size=batch_size)
25 predict_training_input_fn = lambda: my_input_fn(training_examples,
26 training_targets["Survived"],

in my_input_fn(features, targets, batch_size, shuffle, num_epochs)
17 # Construct a dataset, and configure batching/repeating.
18 ds = Dataset.from_tensor_slices((features,targets)) # warning: 2GB limit
---> 19 ds = ds.batch(batch_size).repeat(num_epochs)
20
21 # Shuffle the data, if specified.

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/data/ops/dataset_ops.py in batch(self, batch_size, drop_remainder)
885 Dataset: A Dataset.
886 """
--> 887 return BatchDataset(self, batch_size, drop_remainder)
888
889 def padded_batch(self,

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/data/ops/dataset_ops.py in init(self, input_dataset, batch_size, drop_remainder)
2349 batch_size, dtype=dtypes.int64, name="batch_size")
2350 self._drop_remainder = ops.convert_to_tensor(
-> 2351 drop_remainder, dtype=dtypes.bool, name="drop_remainder")
2352
2353 def _as_variant_tensor(self):

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in convert_to_tensor(value, dtype, name, preferred_dtype)
1048 name=name,
1049 preferred_dtype=preferred_dtype,
-> 1050 as_ref=False)
1051
1052

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in internal_convert_to_tensor(value, dtype, name, as_ref, preferred_dtype, ctx)
1144
1145 if ret is None:
-> 1146 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
1147
1148 if ret is NotImplemented:

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py in _constant_tensor_conversion_function(v, dtype, name, as_ref)
227 as_ref=False):
228 _ = as_ref
--> 229 return constant(v, dtype=dtype, name=name)
230
231

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py in constant(value, dtype, shape, name, verify_shape)
206 tensor_value.tensor.CopyFrom(
207 tensor_util.make_tensor_proto(
--> 208 value, dtype=dtype, shape=shape, verify_shape=verify_shape))
209 dtype_value = attr_value_pb2.AttrValue(type=tensor_value.tensor.dtype)
210 const_tensor = g.create_op(

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py in make_tensor_proto(values, dtype, shape, verify_shape)
540 raise TypeError(
541 "Element type not supported in TensorProto: %s" % numpy_dtype.name)
--> 542 append_fn(tensor_proto, proto_values)
543
544 return tensor_proto

tensorflow/python/framework/fast_tensor_util.pyx in tensorflow.python.framework.fast_tensor_util.AppendBoolArrayToTensorProto()

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/lib/type_check.py in asscalar(failed resolving arguments)
487
488 """
--> 489 return a.item()
490
491 #-----------------------------------------------------------------------------

UnboundLocalError: local variable 'a' referenced before assignment


This is my error. Need help to resolve....

@rribani

This comment has been minimized.

Copy link

commented Jan 23, 2019

Same problem here! I'm using virtualenv with MacOS. Minimal example from @msmsajjadi gives me the error!

@tofulawrence tofulawrence assigned gargn and unassigned tofulawrence Jan 23, 2019

@rribani

This comment has been minimized.

Copy link

commented Jan 24, 2019

Problem solved for me using Python 2.7 and the nightly build from https://pypi.org/project/tf-nightly/

@zyyupup

This comment has been minimized.

Copy link

commented Jan 24, 2019

Problem solved for me using Python 2.7 and the nightly build from https://pypi.org/project/tf-nightly/

Thanks.Also solved with python3.7.

@tkazi

This comment has been minimized.

Copy link

commented Jan 26, 2019

I am using python3.7 as well, and get the same error. Any luck resolving without switching to 2.7 or 3.6?

@zyyupup

This comment has been minimized.

Copy link

commented Jan 28, 2019

I am using python3.7 as well, and get the same error. Any luck resolving without switching to 2.7 or 3.6?
https://pypi.org/project/tf-nightly/#files(CPU)
https://pypi.org/project/tf-nightly-gpu/#files(GPU)
This GPU version needs CUDA10.

@munirulsigo

This comment has been minimized.

Copy link

commented Feb 9, 2019

use nightly build that solved for me
pip install tf-nightly

@liuguiyangnwpu

This comment has been minimized.

Copy link

commented Feb 11, 2019

Traceback (most recent call last): File "/Users/wuming/CodeRepo/TSPADSystem/model/sequence_model/lstm_model.py", line 129, in <module> model.build_model() File "/Users/wuming/CodeRepo/TSPADSystem/model/sequence_model/lstm_model.py", line 47, in build_model model.add(keras.layers.Dropout(self.drop_rate)) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/training/checkpointable/base.py", line 474, in _method_wrapper method(self, *args, **kwargs) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/keras/engine/sequential.py", line 175, in add output_tensor = layer(self.outputs[0]) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 757, in __call__ outputs = self.call(inputs, *args, **kwargs) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/keras/layers/core.py", line 139, in call training = K.learning_phase() File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/keras/backend.py", line 387, in learning_phase False, shape=(), name='keras_learning_phase') File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 5334, in placeholder_with_default "PlaceholderWithDefault", input=input, shape=shape, name=name) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper preferred_dtype=default_dtype) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1146, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 229, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 208, in constant value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py", line 542, in make_tensor_proto append_fn(tensor_proto, proto_values) File "tensorflow/python/framework/fast_tensor_util.pyx", line 134, in tensorflow.python.framework.fast_tensor_util.AppendBoolArrayToTensorProto File "/Users/wuming/tools/virtual/py3ts/lib/python3.7/site-packages/numpy/lib/type_check.py", line 489, in asscalar return a.item() UnboundLocalError: local variable 'a' referenced before assignment

how to fix it ?

@msmsajjadi

This comment has been minimized.

Copy link
Contributor

commented Feb 11, 2019

Here's some minimal examples to get the error:

import tensorflow as tf
tf.Variable(True)
import tensorflow as tf
tf.get_variable('test_bool', 1, tf.bool)

I can confirm that both examples above now work without errors on the latest TensorFlow pip package v1.13.0rc1.

@ChristelSwift

This comment has been minimized.

Copy link

commented Mar 7, 2019

i have the same issue with a fresh install of everything (keras / tensorflow...) but via RStudio. any idea how to solve this in R?

@Rajkiran93

This comment has been minimized.

Copy link

commented Mar 7, 2019

I am using python3.7 as well, and get the same error. Any luck resolving without switching to 2.7 or 3.6?

Even Im using python 3.7, can you try installing pip install tf-nightly, because it solved my problem

@gargn gargn assigned karmel and unassigned gargn Mar 12, 2019

@dtquang89

This comment has been minimized.

Copy link

commented Apr 22, 2019

use nightly build that solved for me
pip install tf-nightly

Thank you. This works for me.

@lauracosgrove

This comment has been minimized.

Copy link

commented May 7, 2019

i have the same issue with a fresh install of everything (keras / tensorflow...) but via RStudio. any idea how to solve this in R?

@ChristelSwift: I was able to get this working by reinstalling the r-tensorflow env. using install_tensorflow(version = "nightly"). keras points to r-tensorflow so it won't work if your nightly build environment is named anything but that.

@EelcoHoogendoorn

This comment has been minimized.

Copy link

commented May 9, 2019

Same issue here, going to python 3.7 on OSX, using conda-forge built tensorflow 1.13.1, gives the same error.

Is there any timeline on when there will be a release that solves this in a production-ready fashion? I know beggars cant be choosers, but this hiccup in going to python 3.7 comes at a bad time, so a fix would be much appreciated. If the nightly takes care of it, it seems pushing out a patch release should be in the cards, no?

Thanks!

@shoreason

This comment has been minimized.

Copy link

commented May 11, 2019

Same issue here running on python 3.7. Many of the recommendations above didn't work for due to a constraint on the tensorflow version (1.5.0) on the backend of Keras in my case.

Ultimately, I reverted back to Python 3.6.8 using pyenv. that did the trick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.