2017-11-08 4 views
0

Ich habe gerade die keras und tensorflow Pakete installiert. Ich möchte mit dem Aufbau einiger Deep-Learning-Modelle beginnen, bin aber sofort dabei, Beispieldaten in die R-Umgebung zu lesen.Fehler beim Einlesen Keras-Datasets - Typ Fehler: 'int' Objekt ist nicht aufrufbar

Betrachten Sie den folgenden Code ein:

#loading keras library 
library(keras) 
library(tensorflow) 

#loading the keras inbuilt cifar10 dataset 
?dataset_cifar10 #to see the help file for details of dataset 
cifar <- dataset_cifar10() 

Wenn ich den Code, den ich die folgende Fehlermeldung aus:

Error in py_call_impl(callable, dots$args, dots$keywords) : 
    TypeError: 'int' object is not callable 

Detailed traceback: 
    File "C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\keras\datasets\mnist.py", line 17, in load_data 
    file_hash='8a61469f7ea1b51cbae51d4f78837e45') 
    File "C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\keras\utils\data_utils.py", line 220, in get_file 
    urlretrieve(origin, fpath, dl_progress) 
    File "C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\urllib\request.py", line 274, in urlretrieve 
    reporthook(blocknum, bs, size) 
    File "C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\keras\utils\data_utils.py", line 213, in dl_progress 
    ProgressTracker.progbar = Progbar(total_size) 
    File "C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\keras\utils\generic_utils.py", line 270, in __init__ 
    self._dynamic_display = (sys.stdout.isatty() or 

Alle Ideen, was hier vor sich geht? Der Vorschlag, das Netzpaket von git hub gegen CRAN zu installieren, wird vorgeschlagen here, aber das löst mein Problem nicht. Irgendwelche Ideen?

Meine Sitzung Informationen, wie es keras und tensorflow bezieht sich hier:

> reticulate::py_config() 
python:   C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\python.exe 
libpython:  C:/Users/stc004/AppData/Local/CONTIN~1/ANACON~1/python36.dll 
pythonhome:  C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1 
version:  3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] 
Architecture: 64bit 
numpy:   C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\numpy 
numpy_version: 1.11.3 
keras:   C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\keras 

python versions found: 
C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\python.exe 
C:\Users\stc004\AppData\Local\Programs\Python\PYTHON~1\\python.exe 
> tf_config() 
TensorFlow v1.2.1 (C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\keras) 
Python v3.6 (C:\Users\stc004\AppData\Local\CONTIN~1\ANACON~1\python.exe) 

Antwort

0

In RStudio-1.1.383 ich das Problem replizieren kann. Das Problem verschwand, als ich die Github-Quelle für Keras klonierte und in Python installierte (nach der documentation).

Eine weitere Idee ist RStudio-1.0.153 verwenden, wo das Problem nicht auftreten sollte (dennoch müssen Sie den Vorschlag aus dem git Hub folgen Sie erwähnt)

0

Ändern Keras Version 2.0.0 half mir mit ähnlichen Problem.

pip install keras==2.0.0 

Ich war 2.0.9 zuvor.

Verwandte Themen