3

I would like to make a LSTM forecasting using Keras. Every time I run the prerequisite step: importing the library

from keras.callbacks import EarlyStopping, ReduceLROnPlateau, ModelCheckpoint, TensorBoard

the following message appears:

The kernel appears to have died. It will restart automatically.

Same problem occurs when I: ìmport keras or import tensorflow.

I am using MacOS version 11.2, 16 GB ram.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Luc
  • 737
  • 1
  • 9
  • 22
  • 1
    Import keras or tensorflow in a python terminal shell and report the error you get in your question. – Dr. Snoopy Mar 14 '21 at 14:19
  • zsh: illegal hardware instruction python – Luc Mar 14 '21 at 22:48
  • ``import pandas` works. `Import keras` and `import tensorflow` result in that message. – Luc Mar 14 '21 at 22:48
  • If you are using an M1 Mac, then see my answer here: https://stackoverflow.com/questions/65242614/why-does-loading-tensorflow-on-mac-lead-to-process-finished-with-exit-code-132/65449643#65449643 The problem is that you somehow installed a x86 library in an ARM python environment (or viceversa). – Dr. Snoopy Mar 14 '21 at 23:15

1 Answers1

1

If you using anaconda in MAC try

conda install -c conda-forge hdf5=1.10.5

If you using idle try

brew install hdf5=1.10.5

If above none of above solved. If you are using anaconda include this lines at the beginning

import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
  • I created a virtualenv and run the code above, but got the message : "Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: - Found conflicts! Looking for incompatible packages." – Luc Mar 14 '21 at 20:08
  • Ok, Have you tried third set of code?. ..Add that couple of lines of code that are at 3rd step at the beginning of your code & Execute them.if you get same error please let me know – Bhargav - Retarded Skills Mar 15 '21 at 04:25