简体   繁体   中英

Why am I receiving this TensorFlow Error?

TypeError: pandas_input_fn should not be called without pandas installed

input_func = tf.compat.v1.estimator.inputs.pandas_input_fn(x=X_train,y=y_train,batch_size=10,
                                                           num_epochs=1000,shuffle=True)

I have pandas installed in my environment, as I've already used it in the same jupyter notebook. I tried installing and uninstall multiple versions of TensorFlow and of Pandas.

Does anybody know what is causing this?

I figured out what was going on. There was an issue with my pc not having Python installed to the right PATH. Tensorflow was using an older verison of Python3, and that was causing Tensorflow to misinterpret which modules were installed in the virtual environment.

The solution was to uninstall Python and anaconda, re-install anaconda, and then create a new environment within anaconda that houses everything. Then it was aatter of making sure that environment had everything necessary and was using correct Python version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM