Giter Site home page Giter Site logo

ValueError about rmdl HOT 18 CLOSED

kk7nc avatar kk7nc commented on July 17, 2024
ValueError

from rmdl.

Comments (18)

gegilligan avatar gegilligan commented on July 17, 2024 3

ISSUE:
"Error in model 0 try to re-generate another model"

FIX:
ModelCheckpoint(filepath,
monitor="val_acc" >>>>>>> monitor="val_accuracy"

I didn't see a definitive solution to this here, so I am posting my solution which worked for me:

Found this on GitHub...
"In Google Colab it works with "val_acc", but in Kaggle with "val_accuracy". Keras related. I believe.

This quote is referring to, in this case, values set in files "RMDL_Image" and "RMDL_Text" for "ModelCheckpoint".

Change the 3 instances in each file from >> to:

monitor="val_acc" >>>> monitor="val_accuracy"

from rmdl.

kk7nc avatar kk7nc commented on July 17, 2024

Thank you for your question
you can try:

RMDL.Text_Classification(X_train, y_train, X_test, y_test,
                         batch_size=batch_size,
                         sparse_categorical=0,
                         random_deep=Random_Deep,
                         epochs=n_epochs)

from rmdl.

saja1994 avatar saja1994 commented on July 17, 2024

Thank you for your answer, after modifying the code as you mentioned a list of errors appeared to me similar to the asked in (kk7nc/HDLTex#5)
{Error in model 0 try to re-generate another model
DNN 0
<keras.optimizers.RMSprop object at 0x0000024BB96999E8>
Error in model 0 try to re-generate another model
DNN 0
<keras.optimizers.Adam object at 0x0000024BB93965F8>
Error in model 0 try to re-generate another model
DNN 0
<keras.optimizers.Adagrad object at 0x0000024C20F14F98>
Error in model 0 try to re-generate another model
DNN 0 }

I read your answer, so have you any advice for me to overcome this error.

Thanks again.

from rmdl.

kk7nc avatar kk7nc commented on July 17, 2024

Thank you for your email, this is not an error, sometimes your memory and hardware of your computer does not capacity to run a model so it tries to reduce it, can you check with only RNN and CNN?

please inform us about your hardware,

Random_Deep = [0,0,3]

RMDL.Text_Classification(X_train, y_train, X_test, y_test,
                         batch_size=batch_size,
                         sparse_categorical=0,
                         random_deep=Random_Deep,
                         epochs=n_epochs)

from rmdl.

ceiecadmin avatar ceiecadmin commented on July 17, 2024

I am having the some problem with 32 Gb of RAM and a 1070 Graphic Memory. Any suggestions?
Thank you.

from rmdl.

kk7nc avatar kk7nc commented on July 17, 2024

can you try by the following option:

Random_Deep = [0,0,3]
batch_size = 20
RMDL.Text_Classification(X_train, y_train, X_test, y_test,
                         batch_size=batch_size,
                         sparse_categorical=0,
                         random_deep=Random_Deep,
                         epochs=n_epochs)

from rmdl.

alvin-leong avatar alvin-leong commented on July 17, 2024

Hello I also have this problem running on Google Colab: I even decreased it to only 1 CNN and batch_size 4

Random_Deep = [0,0,1]
batch_size = 4 # 16 also got prob
n_epochs = 1
Text_Classification(X_train, y_train, X_test, y_test,
batch_size=batch_size,
sparse_categorical=0,
random_deep=Random_Deep,
epochs=n_epochs)

from rmdl.

alvin-leong avatar alvin-leong commented on July 17, 2024

I also faced the same problem when using Tesla P100 on Azure

from rmdl.

alvin-leong avatar alvin-leong commented on July 17, 2024

This is the error I get:

Error in model 0 try to re-generate an other model
CNN 0
Filter 6
Node 350
<keras.optimizers.Adam object at 0x7fc45c06c7b8>
Error in model 0 try to re-generate an other model
CNN 0
Filter 6
Node 400
<keras.optimizers.RMSprop object at 0x7fc41875ef60>
Error in model 0 try to re-generate an other model
CNN 0
Filter 6
Node 183
<keras.optimizers.RMSprop object at 0x7fc41832b630>
Error in model 0 try to re-generate an other model
CNN 0
Filter 5
Node 377
<keras.optimizers.Adagrad object at 0x7fc401eda550>

So I think it is failing at the optimizer?

from rmdl.

kk7nc avatar kk7nc commented on July 17, 2024

Thank you,
Can you explain, did you download GloVe? and can you verify that glove is in there?
the second the code is working for our examples such as Reuters21578 (https://github.com/kk7nc/RMDL/blob/master/Examples/Reuters21578.py)

from rmdl.

tingfang2018 avatar tingfang2018 commented on July 17, 2024

I also have this problem
Error in model 0 try to re-generate an other model
How to deal with it? I change to a small dataset, no effect

from rmdl.

sanja7s avatar sanja7s commented on July 17, 2024

Hi,

Thank you for your methods and code.

I am also getting this error:

<keras.optimizers.Adagrad object at 0x7f374c4c0fd0> Error in model 0 try to re-generate another model

I am simply running your example (on IMBD data) on a server with 128GB memory. So I guess the memory should not be the issue?

Haven't changed anything in the code from your example but pointed to my GloVe folder.

What could be the reason?

from rmdl.

kk7nc avatar kk7nc commented on July 17, 2024

Hi,

Thank you for your methods and code.

I am also getting this error:

<keras.optimizers.Adagrad object at 0x7f374c4c0fd0> Error in model 0 try to re-generate another model

I am simply running your example (on IMBD data) on a server with 128GB memory. So I guess the memory should not be the issue?

Haven't changed anything in the code from your example but pointed to my GloVe folder.

What could be the reason?

Can you test only on DNN the only CNN?
Random_Deep = [0,0,3]
batch_size = 20

RMDL.Text_Classification(X_train, y_train, X_test, y_test,
                         batch_size=batch_size,
                         sparse_categorical=0,
                         random_deep=Random_Deep,
                         epochs=n_epochs)

from rmdl.

sanja7s avatar sanja7s commented on July 17, 2024

Thanks,
when I test, will let you know.

from rmdl.

stanlee321 avatar stanlee321 commented on July 17, 2024

Hi, also the same problem in Colab and in my local machine in 16 GB RAM and 8GB GTX1070
I am trying the MNIST classification example.
Event with this config

Random_Deep = [0,0,3]
batch_size = 20
RMDL.Text_Classification(X_train, y_train, X_test, y_test,
batch_size=batch_size,
sparse_categorical=0,
random_deep=Random_Deep,
epochs=n_epochs)

(28, 28, 1)
<keras.optimizers.Adam object at 0x7f39b67fb780>
Error in model 0 try to re-generate an other model
DNN 0

(28, 28, 1)
<keras.optimizers.Adagrad object at 0x7f39b67c7358>
Error in model 0 try to re-generate an other model
DNN 0

from rmdl.

ben74 avatar ben74 commented on July 17, 2024

Same problem here .. :(
Anyways, that's not related to tensorflow v1/v2 usage, neither the random_deep [0,0,3] or lowering any of the numbers below seem to work

<keras.optimizers.Adagrad object at 0x7f36106ccd30>
Error in model 0 try to re-generate an other model
CNN 0
Filter 7
Node 449

from rmdl.

sharpe5 avatar sharpe5 commented on July 17, 2024

Answer from @gegilligan works well:

Change the 3 instances in each file from >> to:

monitor="val_acc" >>>> monitor="val_accuracy"

Environment:

  • Windows 10 x64
  • nVidia RTX 2080 Ti

Complete setup:

# Run as Anaconda Admin prompt
conda create -n RMDL
conda activate RMDL
conda install -c anaconda tensorflow-gpu
# After "git clone" of RMDL.
conda install --file requirements.txt
# First replace all 'val_acc' with 'val_accuracy' to be compatible with new version of Keras.
python setup.py install
# Install Jupyter Lab
conda install -c conda-forge jupyterlab
jupyter lab

Then copy Examples\MNIST.py to a Jupyter notebook and run.

Try this for a quick test:

n_epochs = [5, 5, 5]  # DNN--RNN-CNN
Random_Deep = [1, 1, 1]  # DNN--RNN-CNN

This error still appears before generating the CNN, but it can be ignored:

Error in model 0  try to re-generate another model
CNN  0 

Looking through the code, it is trying different convolutional network configurations until it finds one that works. Try changing the shape of the image from 28x28 to something else, and it will try more configurations before settling on one that fits. If shape is too awkward (i.e. 112x7) then it will fail altogether, and only the DNN and RNN will work.

from rmdl.

disaalda avatar disaalda commented on July 17, 2024

Hi, I'm still having the same issue with the following message:

Error in model 0 try to re-generate another model CNN 0

Even with the current fix of setting monitor="val_acc" to monitor="val_accuracy". I'm running the MNIST_example.py on Google Colab notebook, on the 2020 MacBook Air with M1 chip, 8GB memory and 256GB storage.

from rmdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.