Open TomasSilva opened 6 months ago
Hi Tomas, thanks a lot. can you be more specific about the AttributeErrors you get (a stack trace would be great), and which tf version caused this for you on which system?
Dear @ruehlef, I was using tensorflow-2.16.1 on an Apple M1 CPU. While running the 2.TensorFlow_models.ipynb notebook, some of the errors I was getting were:
Cell 10: ValueError: Cannot convert '10' to a shape
was raised when trying nn.add(tfk.Input(shape=(n_in)))
. It was solved by adding a comma as nn.add(tfk.Input(shape=(n_in,)))
Cell 14: AttributeError: 'MultFSModel' object has no attribute '_is_compiled'
was raised when trying fmodel, training_history = train_model(fmodel, data, optimizer=opt, epochs=nEpochs, batch_sizes=[64, 50000], verbose=1, custom_metrics=cmetrics, callbacks=cb_list)
.
I tried to modify the FreeModel
parent class, adding self._is_compiled = False
in its __init__
method, and then setting self._is_compiled = True
in its compile
method. But after this modification, I started to get AttributeError: 'function' object has no attribute 'metrics'
(raised after the ìf` evaluation at line 170 of tfmodels.py). After this, I realized that the problems could be due to implementation differences between tensorflow versions, and, indeed, downgrading to tf=2.7.0 solved all the Errors.
Dear all, I was recently following the README installation guide, and found some difficulties running the example Notebooks due to series of 'AttributeError' s coming probably from implementation's differences between Tensorflow/Keras more recent versions. I got around those issues by downgrading Tensorflow to version 2.7.0. I suggest fixing in the reqs file the version 2.7.0 (instead of using >=2.7.0) until further investigation.