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

Problemas con keras.api en el notebook de redes neuronales #57

Open
ferburs opened this issue Dec 2, 2021 · 1 comment
Open

Problemas con keras.api en el notebook de redes neuronales #57

ferburs opened this issue Dec 2, 2021 · 1 comment

Comments

@ferburs
Copy link

ferburs commented Dec 2, 2021

Error:
Using TensorFlow backend.
2021-12-01 19:53:52.739306: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-12-01 19:53:52.739366: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_3692/1235889386.py in
----> 1 import keras
2 from keras.datasets import mnist
3 from keras import backend as K
4 import pandas as pd
5 import numpy as np

~/Escritorio/venv/lib/python3.8/site-packages/keras/init.py in
1 from future import absolute_import
2
----> 3 from . import utils
4 from . import activations
5 from . import applications

~/Escritorio/venv/lib/python3.8/site-packages/keras/utils/init.py in
24 from .layer_utils import get_source_inputs
25 from .layer_utils import print_summary
---> 26 from .vis_utils import model_to_dot
27 from .vis_utils import plot_model
28 from .np_utils import to_categorical

~/Escritorio/venv/lib/python3.8/site-packages/keras/utils/vis_utils.py in
5
6 import os
----> 7 from ..models import Model
8 from ..layers.wrappers import Wrapper
9

~/Escritorio/venv/lib/python3.8/site-packages/keras/models.py in
8 from .utils.generic_utils import has_arg
9 from .utils.generic_utils import to_list
---> 10 from .engine.input_layer import Input
11 from .engine.input_layer import InputLayer
12 from .engine.training import Model

~/Escritorio/venv/lib/python3.8/site-packages/keras/engine/init.py in
6 from .base_layer import Layer
7 from .network import get_source_inputs
----> 8 from .training import Model

~/Escritorio/venv/lib/python3.8/site-packages/keras/engine/training.py in
12 from .network import Network
13 from .base_layer import Layer
---> 14 from . import training_utils
15 from . import training_arrays
16 from . import training_generator

~/Escritorio/venv/lib/python3.8/site-packages/keras/engine/training_utils.py in
15 from .. import backend as K
16 from .. import losses
---> 17 from .. import metrics as metrics_module
18 from ..utils import Sequence
19 from ..utils import generic_utils

~/Escritorio/venv/lib/python3.8/site-packages/keras/metrics.py in
1848 import tensorflow as tf
1849 if tf.version >= '2.0.0':
-> 1850 BaseMeanIoU = tf.keras.metrics.MeanIoU
1851
1852

~/Escritorio/venv/lib/python3.8/site-packages/tensorflow/python/util/lazy_loader.py in getattr(self, item)
60
61 def getattr(self, item):
---> 62 module = self._load()
63 return getattr(module, item)
64

~/Escritorio/venv/lib/python3.8/site-packages/tensorflow/python/util/lazy_loader.py in _load(self)
43 """Load the module and insert it into the parent's globals."""
44 # Import the target module and insert it into the parent's namespace
---> 45 module = importlib.import_module(self.name)
46 self._parent_module_globals[self._local_name] = module
47

/usr/lib/python3.8/importlib/init.py in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
128
129

ModuleNotFoundError: No module named 'keras.api'

@ferburs
Copy link
Author

ferburs commented Dec 2, 2021

Solucion:

Desde entorno virtual = pip install "keras >= 2.6.0".

Empezo a correr bien el archivo hasta cierto punto que tiro: "module keras.optimizers has no attribute "SGD"

Para eso en la parte superior del archivo agregar: from tensorflow.keras import optimizers y cambiar la linea por optimizers.SGD

(lo mismo para otras fallas del mismo estilo con keras)

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