1

i'm working on a classifier that uses CNN and i need to use the keras tuner so i can find the best CNN architecture

i executed this command "pip install keras-tuner" and it was installed successfully

but when i import it "import keras_tuner as kt" and run the python script

No module named 'keras_tuner'

i'm working offline with python 3.7.9,tensorflow 2.0,keras 2.7 in VSCode

can someone help me? i really need to use the tuner

thanks

Jood jindy
  • 320
  • 4
  • 18

2 Answers2

3

so i used

pip install keras_tuner

in VSCode and the packge was really installed but in the global site-packages folder and not in venv/lib folder

so all i did is that i went to venv/pyvenv.cfg file in VSCode

and set

include-system-site-packages = true
Jood jindy
  • 320
  • 4
  • 18
0

I had the same issue using PyCharm. When I installed the keras-tuner package in the Anaconda 3 prompt, I got the message that everything is already installed. The problem was, that the keras-tuner was installed in my base environment and not in the environment (virtual) which I use in PyCharm. You simply need to do the following.

  1. check out your environments in the anaconda prompt using: conda env list you will probably see the * on the base environment
  2. now change to your working environment for example conda activate tf_cpu -> tf_cpu needs to be changed by your envs name (see on your list)
  3. install your package such as pip install keras_tuner
Zeit
  • 13
  • 5