I have an AMD GPU pc which I have recently started to use with Linux Mint O.S. I've seen a way of installing ROCm on this pc following this tutorial, but when I tried to write a Python program using Keras it threw these errors. Here is my code:
import numpy as np
from numpy import genfromtxt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense
data=genfromtxt('../DATA/bank_note_data.txt',delimiter=',')
labels=data[:,4]
features=data[:,0:4]
X=features
y=labels
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.33,random_state=42)
scalerObject=MinMaxScaler()
scalerObject.fit(X_train)
scaled_X_train=scalerObject.transform(X_train)
scaled_X_test=scalerObject.transform(X_test)
model=Sequential()
model.add(Dense(4,input_dim=4,activation='relu'))
model.add(Dense(8,activation='relu'))
model.add(Dense(1,activation='sigmoid'))
model.compile(loss='binary_crossentropy',optimizer='adam',metrics=['accuracy'])
model.fit(scaled_X_train,y_train,epochs=50,verbose=2)
print(model.fit(scaled_X_train,y_train,epochs=50,verbose=2))
These were the errors:
Traceback (most recent call last):
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: librccl.so: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/cemosambora/eclipse-workspace/Deep_Learning_OpenCV/kerasBasics.py", line 5, in <module>
from keras.models import Sequential
File "/home/cemosambora/.local/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/home/cemosambora/.local/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/home/cemosambora/.local/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/cemosambora/.local/lib/python3.6/site-packages/keras/backend/__init__.py", line 89, in <module>
from .tensorflow_backend import *
File "/home/cemosambora/.local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/cemosambora/.local/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/usr/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: librccl.so: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
This page has some common reasons and solutions.