MLBazaar / MLBazaar/MLPrimitives

tensorflow `get_config` error

Open
#260 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
70
Forks
37
PR merge metrics
No merged PRs in 30d

Description

  • MLPrimitives version: 0.3.0
  • Python version: 3.6
Description

The current version of MLPrimitives will automatically install tensorflow 2.3.4.

This version will encounter the following issue:

/usr/local/lib/python3.6/site-packages/keras/backend.py in <module>
     34 from tensorflow.core.protobuf import config_pb2
     35 from tensorflow.python.eager import context
---> 36 from tensorflow.python.eager.context import get_config
     37 from tensorflow.python.framework import config
     38 from keras import backend_config

ImportError: cannot import name 'get_config'

Because of the piece of code from mlprimitives/adapters/keras.py


import logging
import tempfile

import keras        # this is the line causing error
import numpy as np
Solution

Simply replace

import keras

as

from tensorflow import keras

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The failing import is in mlprimitives/adapters/keras.py; start by reading that adapter and reproducing the TensorFlow/Keras import error with the versions listed in the issue. Done means the adapter imports successfully with TensorFlow 2.3.4 and the relevant tests or import checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
keras, python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.