Palashio / libra

Ergonomic machine learning for everyone.
http://libradocs.org/
MIT License
1.92k stars 109 forks source link

upgrade broke from libra import #366

Closed fredzannarbor closed 4 years ago

fredzannarbor commented 4 years ago

I upgraded to the new version and it broke. Looks as if it did not correctly update all the dependencies.

How can I roll back to the previous version?

 python dvids_search.py --frontmatter "/Users/fred/bin/nimble/dvids/templates/nationalleaders.json" --max_results "50" --dryrun "True" --loopoverfield "keywords" --infile "data/biden"
Traceback (most recent call last):
  File "dvids_search.py", line 36, in <module>
    **from libra import ***
  File "/usr/local/lib/python3.8/site-packages/libra/__init__.py", line 1, in <module>
    from .queries import client
  File "/usr/local/lib/python3.8/site-packages/libra/queries.py", line 12, in <module>
    from libra.query.feedforward_nn import (regression_ann,
  File "/usr/local/lib/python3.8/site-packages/libra/query/feedforward_nn.py", line 5, in <module>
    import tensorflowjs as tfjs
  File "/usr/local/lib/python3.8/site-packages/tensorflowjs/__init__.py", line 21, in <module>
    from tensorflowjs import converters
  File "/usr/local/lib/python3.8/site-packages/tensorflowjs/converters/__init__.py", line 24, in <module>
    from tensorflowjs.converters.tf_saved_model_conversion_v2 import convert_tf_saved_model
  File "/usr/local/lib/python3.8/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 38, in <module>
    import tensorflow_hub as hub
  File "/usr/local/lib/python3.8/site-packages/tensorflow_hub/__init__.py", line 29, in <module>
    from tensorflow_hub.estimator import LatestModuleExporter
  File "/usr/local/lib/python3.8/site-packages/tensorflow_hub/estimator.py", line 64, in <module>
    class LatestModuleExporter(tf_v1.estimator.Exporter):
  File "/usr/local/lib/python3.8/site-packages/tensorflow/python/util/lazy_loader.py", line 62, in __getattr__
    module = self._load()
  File "/usr/local/lib/python3.8/site-packages/tensorflow/python/util/lazy_loader.py", line 45, in _load
    module = importlib.import_module(self.__name__)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/local/lib/python3.8/site-packages/tensorflow_estimator/__init__.py", line 10, in <module>
    from tensorflow_estimator._api.v1 import estimator
  File "/usr/local/lib/python3.8/site-packages/tensorflow_estimator/_api/v1/estimator/__init__.py", line 10, in <module>
    from tensorflow_estimator._api.v1.estimator import experimental
  File "/usr/local/lib/python3.8/site-packages/tensorflow_estimator/_api/v1/estimator/experimental/__init__.py", line 10, in <module>
    from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
  File "/usr/local/lib/python3.8/site-packages/tensorflow_estimator/python/estimator/canned/dnn.py", line 23, in <module>
    from tensorflow.python.feature_column import dense_features
  File "/usr/local/lib/python3.8/site-packages/tensorflow/python/feature_column/dense_features.py", line 30, in <module>
    class DenseFeatures(fc._BaseFeaturesLayer):  # pylint: disable=protected-access
AttributeError: module 'tensorflow.python.feature_column.feature_column_v2' has no attribute '_BaseFeaturesLayer'
sukkritsharmaofficial commented 4 years ago

Hi @fredzannarbor, would you mind telling us if which version of TensorFlow are you using right now?

Make sure you have the latest tensorflow version, i.e 2.3.0 and have upgraded to libra correctly. I suggest that you try to upgrade your libra using following commands :

pip3 install -U libra

If that doesn't work for you try :

pip3 install -U tensorflow tensorflowjs libra prompt-toolkit

if you still wish to revert back to the older version you can do that with the following command :

pip3 install libra==1.1.2

Let us know which one works for you! 😄