Answers.Body: <p>If I understand your question correctly, you are asking whether you could load the saved weights of a trained model with the Xception architecture on a a Resnet50 architecture.</p>
  
  <p><strong>Short answer: No</strong></p>
  
  <p><strong>Long answer</strong>: Xception and Resnet50 have very different architectures. </p>
  
  <p>Here is a paper comparing multilple CNNs including Xception and Resnet50:
  <a href="https://www.researchgate.net/publication/330478807_Deep_Feature-Based_Classifiers_for_Fruit_Fly_Identification_Diptera_Tephritidae/figures?lo=1" rel="nofollow noreferrer">https://www.researchgate.net/publication/330478807_Deep_Feature-Based_Classifiers_for_Fruit_Fly_Identification_Diptera_Tephritidae/figures?lo=1</a></p>
  
  <p>As you can see, the architectures are quiet different between Xception and ResNet50. Thus when you train a model, you are changing the weights and bias of the different layers of the model. If you switch models, and they are similar like let's say VGG16 and VGG19, you could import part of the weights for the layers which are similar between the two models.
  As far as I know, I don't know of a function which can do this operation in tensorflow or keras.
  But in your case, the architectures are extremely different between Xception and ResNet and there seem not to have any layers in common.</p>
  
  <p>In general, one train a model, save the weights of the training, import back the weights, and use the same model for the next round of training/testing/predictions.</p>
  
  <p>Hope that helps!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T06:55:52.747Z
Answers.Text: Awesome happy to hear that! I hope other people also try to answer the question so we get more insights.
Answers.UserDisplayName: Dr. H. Lecter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T06:56:55.860Z
Answers.Text: exactly~! let's see whether someone could come up with different ideas :)
Answers.UserDisplayName: Franva
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T06:58:00.633Z
Answers.Text: btw, what do you call the trained .h5 file? the saved wrights fill?? do we have some shorter names?
Answers.UserDisplayName: Franva
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T08:21:23.357Z
Answers.Text: Either the saved weights file (in tensorflow): model.save_weights("yourfilename.h5")
  Or the saved model:
  model.save("yourfilename.h5"). The saved model contains all the layers, weights, biases and the optimizer features.
Answers.UserDisplayName: Dr. H. Lecter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T06:52:22.893Z
Answers.LastActivityDate: 2019-09-09T06:52:22.893Z
Answers.UserDisplayName: Dr. H. Lecter
Body: <p>I have been running my 2013 server box since 2 weeks ago for training an AI model.
  I set up 30 epochs to run but since than it only ran 1 epoch as my PC config is super slow. But it generates 1 .h5 file. </p>
  
  <p>My question is will this .h5 file that I trained with Xception model work for Resnet 50?</p>
  
Tags: <training><models><hyper-parameters>
Title: Will a .h5 file trained with Xception model work with Resnet50?
UserDisplayName: Franva
ThreadText: # Will a .h5 file trained with Xception model work with Resnet50?
  
  (Asked by: username_0 on 2019-09-09)
  
  I have been running my 2013 server box since 2 weeks ago for training an AI model.
  I set up 30 epochs to run but since than it only ran 1 epoch as my PC config is super slow. But it generates 1 .h5 file.
  
  My question is will this .h5 file that I trained with Xception model work for Resnet 50?
  
  **Tags:** training, models, hyper-parameters
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-09-09. Score: 1 | Accepted answer
  
  If I understand your question correctly, you are asking whether you could load the saved weights of a trained model with the Xception architecture on a a Resnet50 architecture.
  
  **Short answer: No**
  
  **Long answer**: Xception and Resnet50 have very different architectures.
  
  Here is a paper comparing multilple CNNs including Xception and Resnet50:
  <https://www.researchgate.net/publication/330478807_Deep_Feature-Based_Classifiers_for_Fruit_Fly_Identification_Diptera_Tephritidae/figures?lo=1>
  
  As you can see, the architectures are quiet different between Xception and ResNet50. Thus when you train a model, you are changing the weights and bias of the different layers of the model. If you switch models, and they are similar like let's say VGG16 and VGG19, you could import part of the weights for the layers which are similar between the two models.
  As far as I know, I don't know of a function which can do this operation in tensorflow or keras.
  But in your case, the architectures are extremely different between Xception and ResNet and there seem not to have any layers in common.
  
  In general, one train a model, save the weights of the training, import back the weights, and use the same model for the next round of training/testing/predictions.
  
  Hope that helps!
  
  > **Comments:**
  > **username_1**: Awesome happy to hear that! I hope other people also try to answer the question so we get more insights.  
  > **username_0**: exactly~! let's see whether someone could come up with different ideas :)  
  > **username_0**: btw, what do you call the trained .h5 file? the saved wrights fill?? do we have some shorter names?  
  > **username_1**: Either the saved weights file (in tensorflow): model.save_weights("yourfilename.h5") Or the saved model: model.save("yourfilename.h5"). The saved model contains all the layers, weights, biases and the optimizer features.  
  
  ---
  
  