Comments (11)
The issue arises from:
model.fit(X_train, y_train_ohe, nb_epoch=50, batch_size=300, verbose=1, validation_split=0.1, show_metrics=True)
which is from a book (Python Machine Learning by @rasbt https://github.com/rasbt/python-machine-learning-book. It's awesome, but I guess the code gets old quick!)
The new way of doing it means to add metrics=['accuracy'] to the
model.compilesection, rather than the
model.fit`:
model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
I've just run into this issue, and changing the code in these places worked for me :D
from hyperas.
@isrugeek As noted above: replace the show_accuracy=True
statement with metrics=['accuracy']
I'm not sure exactly where this applies, but it is either in the code you are writing, or it is in existing (example) code in Keras/Hyperas if it has not yet been fixed. Note: I had too many issues with Hyperas, I used Hyperopt instead.
from hyperas.
@jdelange Thanks but after i changed it shows me another error
TypeError: Received unknown keyword arguments: {'metrics': ['accuracy']}
from hyperas.
@isrugeek Sorry, can't see what you are doing. The syntax provided is correct, so the call may not be applicable/available in your case? Sounds quite basic. Not sure how experienced you are. Have a look at this site Machine learning mastery lots of basic examples to get started. Helped me a lot.
from hyperas.
@jdelange How did you fix this issue i also got this Issue in my Project ( Not this Code)
Thanks in Advance
from hyperas.
@jdelange Thanks buddy. i am confused because it works on my different machine and not on MacBook . any how i fixed the problem by edit the Model.py( Keras File) by comparing my Old machine.
Thanks
from hyperas.
@JAStark The keras section? Oh yeah, that was 2015 :P. The next edition will have up-to-date tensorflow >= 1.0 code ;)
from hyperas.
@rasbt yes! Chapter 13 :)
from hyperas.
ok, it's updated now in the readme. Note that you're free to leave out additional arguments in examples as you want, hyperas is just a wrapper, not a prescription. :)
from hyperas.
@JAStark thanks
from hyperas.
@JAStark good answer,thanks
from hyperas.
Related Issues (20)
- NameError: name 'train_predict' is not defined HOT 5
- Cross validation inside 'data' function HOT 5
- UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 885: illegal multibyte sequence
- UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 885: illegal multibyte sequence
- UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 885: illegal multibyte sequence HOT 3
- Optmizing CNN - TypeError: module, class, method, function, traceback, frame, or code object was expected, got tuple HOT 2
- Cannot run hyperas on databricks, [Errno 2] No such file or directory: "/databrikcs/driver/notebook_name" HOT 1
- custom def on kernel_initializer
- How can it be guaranteed to run all combinations if only "choice" is used.
- AttributeError: 'numpy.random.mtrand.RandomState' object has no attribute 'integers' HOT 13
- KeyError: job exception: 'val_acc' HOT 2
- Can Hyperas natively return data regarding all models ran during an optimization cycle? HOT 1
- Why hyperas is executing Raw Text as code HOT 1
- AttributeError: numpy.random.mtrand.RandomState object has no attribute 'integers'
- global variable issue HOT 2
- module 'hyperopt.pyll' has no attribute 'base' HOT 1
- getting issue in this code is there anyone can help me out? It will be greatfull... #Building another model/classifier ISOLATION FOREST from sklearn.ensemble import IsolationForest ifc=IsolationForest(max_samples=len(X_train), contamination=outlier_fraction,random_state=1) ifc.fit(X_train) scores_pred = ifc.decision_function(X_train) y_pred = ifc.predict(X_test) # Reshape the prediction values to 0 for valid, 1 for fraud. y_pred[y_pred == 1] = 0 y_pred[y_pred == -1] = 1 n_errors = (y_pred != Y_test).sum()
- getting issue in this code is there anyone can help me out? It will be greatfull... HOT 1
- I am having error of No such file or directory: 'C:\\Users\\fnur42\\AppData\\Local\\Temp\\ipykernel_3156\\3188587457.py'.This error shows in the best_run,best_model line. What is ipykernel file and how I can create it?
- I always have this error after executing the following code : NameError: name 'x_train' is not defined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperas.