You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please make sure that the boxes below are checked before you submit your issue.
If your issue is an implementation question, please ask your question on StackOverflow or on the Keras Slack channel instead of opening a GitHub issue.
Thank you!
Check that you are up-to-date with the master branch of Keras. You can update with: pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps
Check that your version of TensorFlow is up-to-date. The installation instructions can be found here.
Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
Introduction
I'm currently following the Plural Sight course on setting up Keras and using it for Object Detection. However with the second script I'm running into an AssertionError:
Code used for the course:
# deep_circles.py# Defines a network that can find separate circles of data## Importsfromsklearn.datasetsimportmake_circlesimportnumpyasnpimportmatplotlib.pyplotaspltimportosos.environ["TF_CPP_MIN_LOG_LEVEL"]="2"# Helper functions# plot the data on a figuredefplot_data(pl, X, y):
# plot class where y==0pl.plot(X[y==0, 0], X[y==0,1], 'ob', alpha=0.5)
# plot class where y==1pl.plot(X[y==1, 0], X[y==1,1], 'xr', alpha=0.5)
pl.legend(['0', '1'])
returnpl# Common function that draws the decision boundariesdefplot_decision_boundary(model, X, y):
amin, bmin=X.min(axis=0) -0.1amax, bmax=X.max(axis=0) +0.1hticks=np.linspace(amin, amax, 101)
vticks=np.linspace(bmin, bmax, 101)
aa, bb=np.meshgrid(hticks, vticks)
ab=np.c_[aa.ravel(), bb.ravel()]
# make prediction with the model and reshape the output so contourf can plot itc=model.predict(ab)
Z=c.reshape(aa.shape)
plt.figure(figsize=(12, 8))
# plot the contourplt.contourf(aa, bb, Z, cmap='bwr', alpha=0.2)
# plot the moons of dataplot_data(plt, X, y)
returnplt# Generate some data blobs. Data will be either 0 or 1 when 2 is number of centers.# X is a [number of samples, 2] sized array. X[sample] contains its x,y position of the sample in the space# ex: X[1] = [1.342, -2.3], X[2] = [-4.342, 2.12]# y is a [number of samples] sized array. y[sample] contains the class index (ie. 0 or 1 when there are 2 centers)# ex: y[1] = 0 , y[1] = 1X, y=make_circles(n_samples=1000, factor=.6, noise=0.1, random_state=42)
#pl = plot_data(plt, X, y)#pl.show()# Split the data into Training and Test setsfromsklearn.model_selectionimporttrain_test_splitX_train, X_test, y_train, y_test=train_test_split(X, y, test_size=0.3, random_state=42)
# Create the keras modelfromkeras.modelsimportSequentialfromkeras.layersimportDensefromkeras.optimizersimportAdam# Simple Sequential modelmodel=Sequential()
model.add(Dense(4, input_shape=(2,), activation="tanh", name="Hidden-1"))
model.add(Dense(4, activation="tanh", name="Hidden-2"))
# Add a Dense Fully Connected Layer with 1 neuron. Using input_shape = (2,) says the input will # be arrays of the form (*,2). The first dimension will be an unspecified # number of batches (rows) of data. The second dimension is 2 which are the X, Y positions of each data element.# The sigmoid activation function is used to return 0 or 1, signifying the data # cluster the position is predicted to belong to.model.add(Dense(1, activation="sigmoid", name="output_layer"))
model.summary()
# Compile the model. Minimize crossentopy for a binary. Maximize for accuracymodel.compile(Adam(lr=0.05), 'binary_crossentropy', metrics=['accuracy'])
fromkeras.utilsimportplot_modelplot_model(model, to_file="model.png", show_shapes=True, show_layer_names=True)
# The line above here fails# Define early stopping callbackfromkeras.callbacksimportEarlyStoppingmy_callbacks= [EarlyStopping(monitor='val_acc', patience=5, mode='max')]
# Fit the model with the data from make_blobs. Make 100 cycles through the data.# Set verbose to 0 to supress progress messages model.fit(X_train, y_train, epochs=100, verbose=1, callbacks=my_callbacks, validation_data=(X_test, y_test))
# Get loss and accuracy on test dataeval_result=model.evaluate(X_test, y_test)
# Print test accuracyprint("\n\nTest loss:", eval_result[0], "Test accuracy:", eval_result[1])
# Plot the decision boundaryplot_decision_boundary(model, X, y).show()
There's already a duplicate of this issue but it was closed without a fix: #12538
I mean honestly wtf, hacking code into the Keras library without actually commiting it != a fix 😄
@ymodak, you asked for a way to reproduce this error. All this information should be enough for this.
My environment
OS: Windows 10
Python install: MiniConda with 3.6
CUDA: Yes
I already tried to figure out what's going on and it seems that at some point a file named dot.bat is called which returned exit code 1.
Path of dot.bat: C:\Users\******\AppData\Local\conda\conda\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\dot.bat
If I check out that file it calls dot.exe Path of dot.exe: C:\Users\********\AppData\Local\conda\conda\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\graphviz\dot.exe
When you check out the screenshot, you can see on the bottom the commands that are being used to call dot.bat:
Please make sure that the boxes below are checked before you submit your issue.
If your issue is an implementation question, please ask your question on StackOverflow or on the Keras Slack channel instead of opening a GitHub issue.
Thank you!
Check that you are up-to-date with the master branch of Keras. You can update with:
pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps
Check that your version of TensorFlow is up-to-date. The installation instructions can be found here.
Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).
Introduction
I'm currently following the Plural Sight course on setting up Keras and using it for Object Detection. However with the second script I'm running into an AssertionError:
Code used for the course:
There's already a duplicate of this issue but it was closed without a fix: #12538
I mean honestly wtf, hacking code into the Keras library without actually commiting it != a fix 😄
@ymodak, you asked for a way to reproduce this error. All this information should be enough for this.
My environment
OS: Windows 10
Python install: MiniConda with 3.6
CUDA: Yes
Commands I ran:
Note: graphviz is automatically installed.
My investigation
I already tried to figure out what's going on and it seems that at some point a file named
dot.bat
is called which returned exit code 1.Path of dot.bat: C:\Users\******\AppData\Local\conda\conda\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\dot.bat
If I check out that file it calls dot.exe
Path of dot.exe: C:\Users\********\AppData\Local\conda\conda\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\graphviz\dot.exe
When you check out the screenshot, you can see on the bottom the commands that are being used to call dot.bat:
['dot.bat', '-Tps', 'C:\\Users\\********\\AppData\\Local\\Temp\\tmpd7q3ltxy'] return code: 1
If I however check the Temp directory to see if there's a file named
tmpd7q3ltxy
. There is none.Question
Does anyone have any idea what's going on here?
The text was updated successfully, but these errors were encountered: