I am trying to follow a tutorial for deep learning. I can use my desktop but not my laptop, and I can't find an explanation for why not. I thought it might be that I have python3 installed incorrectly so I reformatted the disk and tried again. Same result.
The test program with most of the lines commented out is
import numpy as np
import tensorflow as tf
#import keras as ks
#from keras.models import Sequential
#from keras.layers import LSTM, Input, Dropout
#from keras.layers import Dense
#rom keras.layers import RepeatVector
#from keras.layers import TimeDistributed
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.preprocessing import MinMaxScaler, StandardScaler
#from keras.models import Model
import seaborn as sns
#dataframe = pd.read_csv('data/GE.csv')
#df = dataframe[['Date', 'Close']]
#df['Date'] = pd.to_datetime(df['Date'])
#sns.lineplot(x=df['Date'], y=df['Close'])
#print("Start date is: ", df['Date'].min())
#print("End date is: ", df['Date'].max())
print("Hello")
If I comment out line 2 with the import tensorflow then it will reach the end and print Hello. If I remove the comment on either tensorflow or keras, the program will crash with a core dump.
My initial guess was perhaps python3 was missing something, so I used synaptic on both the desktop and the laptop. With the hundreds of python3 entries, I failed to see anything which was missing.
Another possibility was either tensorflow or keras was not properly installed, or that keras was missing some prerequisite file. Looking at the documentation, and failed to see anything missing. I also looked to see if they were installed. I got:
ilan@ilan-Lenovo-G585:~$ pip3 list | grep -i keras
Keras 2.4.3
Keras-Applications 1.0.6
Keras-Preprocessing 1.1.2
ilan@ilan-Lenovo-G585:~$ pip3 list | grep -i tensorflow
tensorflow 2.3.1
tensorflow-estimator 2.3.0
tensorflow-gpu 2.3.1
ilan@ilan-Lenovo-G585:~$ cd ilan/python/python/
ilan@ilan-Lenovo-G585:~/ilan/python/python$ ls
data ds180.txt test.py
ilan@ilan-Lenovo-G585:~/ilan/python/python$ python3 test.py
Illegal instruction (core dumped)
ilan@ilan-Lenovo-G585:~/ilan/python/python$
The error message didn't give me a clue as to what could be wrong. It just said illegal instruction with a core dump. Import tensorflow as tf isn't exactly illegal, so something must have happened behind the scenes, but what??
Thanks for pointing out that my CPU is simply not good enough to do Tensor flow. This is the first time I have come across such a case, so it didn't cross my mind as a possibility....