predict with Keras fails due to faulty environment setup

前端 未结 3 1136
慢半拍i
慢半拍i 2021-01-22 03:46

I can\'t get Keras to predict anything. Not even in this minimalistic model:

from keras.models import Sequential
from keras.layers import Dense
import numpy as np         


        
3条回答
  •  攒了一身酷
    2021-01-22 04:36

    It turned out the code wasn't the problem, but there was something wrong with my software. After the following steps, the above code runs without errors or warnings:

    1. uninstall anaconda
    2. install anaconda
    3. create new environment
    4. install required packages into that environment (keras, tensorflow, spyder...)
    5. run code in that environment

提交回复
热议问题