dhammack / DSB2017

Code for 2nd place solution to the 2017 National Data Science Bowl
346 stars 156 forks source link

load_model #6

Closed qianwangn closed 7 years ago

qianwangn commented 7 years ago

when i load your trained model,i got some error like : ValueError: Improper config format: {u'l2': 9.999999747378752e-05, u'name': u'L1L2Regularizer', u'l1': 0.0}

already tried all the keras version,still cant load your mode

qianwangn commented 7 years ago

hello daniel: I really need to know your keras version when you build the trained model thanks a lot

dhammack commented 7 years ago

Thanks for pointing this out.

From a timeline perspective, the competition ran from about the beginning of 2017 to March 2017, and I avoided updating Keras during the competition. So probably it is a version released prior to Jan 2017.

I would guess version 1.2.0.

Ultimately Keras changed their model save/load formats between versions 1 and 2. If you are unable to load the models with an old version then the best solution may be to read them with h5py and manually convert the models to the format that Keras wants for 2.0. Alternatively you should be able to retrain them with the provided training code, but that will take some time.

qianwangn commented 7 years ago

sorry to bother you ,due to the version problem,still have another problem: TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

I believer this is because the tensorflow version isn't right

I tried to retrain your training code in 2 Tesla m40(about 36 hours for 1 epoch), it still need to much time.so i think it was better to use your trained model.

Thanks a lot

qianwangn commented 7 years ago

quenstion solverd:

keras version:1.2.2 tensorflow version:0.12.0

tensorflow changed that function: tf.contanct

dhammack commented 7 years ago

Two comments:

1) My code uses the theano backend. I think you can load theano models in tensorflow using Keras but I can't guarantee that.

2) Each of my models only takes a few hours to train completely on a Tesla K80 (amazon p2.xlarge instance). They should definitely not take as long as you report.

dhammack commented 7 years ago

Was the issue with looks_linear_init not found solved? I don't see the comment here any longer.

qianwangn commented 7 years ago

Thanks ,looks_linear_init isssue was solved, its because the version problem,when i use keras==1.2.2,this error message dont appear again.