Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation problem on ubuntu #1251

Open
Areshey opened this issue Feb 18, 2022 · 0 comments
Open

installation problem on ubuntu #1251

Areshey opened this issue Feb 18, 2022 · 0 comments

Comments

@Areshey
Copy link

Areshey commented Feb 18, 2022

Dear authors of aima-python
I have problem when i tried to install the aima-python on my computer. could you please see the error message below

============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /home/pc/aima-python, configfile: pytest.ini
plugins: cov-3.0.0
collected 419 items

tests/test_agents.py ................ [ 3%]
tests/test_agents4e.py ................ [ 7%]
tests/test_csp.py ......................................... [ 17%]
tests/test_deep_learning4e.py ...F [ 18%]
tests/test_games.py ... [ 19%]
tests/test_games4e.py .... [ 20%]
tests/test_knowledge.py ........... [ 22%]
tests/test_learning.py ............... [ 26%]
tests/test_learning4e.py ............. [ 29%]
tests/test_logic.py ...................................... [ 38%]
tests/test_logic4e.py .................................... [ 47%]
tests/test_mdp.py ...... [ 48%]
tests/test_mdp4e.py ...... [ 49%]
tests/test_nlp.py .................... [ 54%]
tests/test_nlp4e.py ............ [ 57%]
tests/test_perception4e.py .......F. [ 59%]
tests/test_planning.py ..................................... [ 68%]
tests/test_probabilistic_learning.py . [ 68%]
tests/test_probability.py ........................ [ 74%]
tests/test_probability4e.py ...................... [ 79%]
tests/test_reinforcement_learning.py .... [ 80%]
tests/test_reinforcement_learning4e.py .... [ 81%]
tests/test_search.py .......................... [ 87%]
tests/test_text.py ............... [ 91%]
tests/test_utils.py .................................... [100%]

=================================== FAILURES ===================================
_______________________________ test_autoencoder _______________________________

def test_autoencoder():
    iris = DataSet(name='iris')
    classes = ['setosa', 'versicolor', 'virginica']
    iris.classes_to_numbers(classes)
    inputs = np.asarray(iris.examples)
  al = AutoencoderLearner(inputs, 100)

tests/test_deep_learning4e.py:74:


inputs = array([[5.1, 3.5, 1.4, 0.2, 0. ],
[4.9, 3. , 1.4, 0.2, 0. ],
[4.7, 3.2, 1.3, 0.2, 0. ],
[4.6, 3.1... 5. , 1.9, 2. ],
[6.5, 3. , 5.2, 2. , 2. ],
[6.2, 3.4, 5.4, 2.3, 2. ],
[5.9, 3. , 5.1, 1.8, 2. ]])
encoding_size = 100, epochs = 200, verbose = False

def AutoencoderLearner(inputs, encoding_size, epochs=200, verbose=False):
    """
    Simple example of linear auto encoder learning producing the input itself.
    :param inputs: a batch of input data in np.ndarray type
    :param encoding_size: int, the size of encoding layer
    :param epochs: number of epochs
    :param verbose: verbosity mode
    :return: a keras model
    """

    # init data
    input_size = len(inputs[0])

    # init model
    model = Sequential()
    model.add(Dense(encoding_size, input_dim=input_size, activation='relu', kernel_initializer='random_uniform',
                    bias_initializer='ones'))
    model.add(Dense(input_size, activation='relu', kernel_initializer='random_uniform', bias_initializer='ones'))

    # update model with sgd
  sgd = optimizers.SGD(lr=0.01)

E AttributeError: module 'keras.optimizers' has no attribute 'SGD'

deep_learning4e.py:578: AttributeError
_____________________________ test_simple_convnet ______________________________

def test_simple_convnet():
  train, val, test = load_MINST(1000, 100, 10)

tests/test_perception4e.py:65:


train_size = 1000, val_size = 100, test_size = 10

def load_MINST(train_size, val_size, test_size):
    """Load MINST dataset from keras"""
    (x_train, y_train), (x_test, y_test) = mnist.load_data()
    total_size = len(x_train)
    if train_size + val_size > total_size:
        train_size = total_size - val_size
    x_train = x_train.reshape(x_train.shape[0], 1, 28, 28)
    x_test = x_test.reshape(x_test.shape[0], 1, 28, 28)
    x_train = x_train.astype('float32')
    x_train /= 255
    test_x = x_test.astype('float32')
    test_x /= 255
  y_train = keras.utils.to_categorical(y_train, 10)

E AttributeError: module 'keras.utils' has no attribute 'to_categorical'

perception4e.py:312: AttributeError
=========================== short test summary info ============================
FAILED tests/test_deep_learning4e.py::test_autoencoder - AttributeError: modu...
FAILED tests/test_perception4e.py::test_simple_convnet - AttributeError: modu...
=================== 2 failed, 417 passed in 73.95s (0:01:13) ===================

@Areshey Areshey changed the title installation problem installation problem on ubuntu Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant