machine-learning-model

Saving a 'fine-tuned' bert model

时光怂恿深爱的人放手 提交于 2021-01-29 00:24:54
问题 I am trying to save a fine tuned bert model. I have ran the code correctly - it works fine, and in the ipython console I am able to call getPrediction and have it result the result. I have my weight files saved (highest being model.ckpt-333.data-00000-of-00001 I have no idea how I would go about saving the model to be reuseable. I am using bert-tensorflow. import json import pandas as pd import tensorflow as tf import tensorflow_hub as hub from datetime import datetime from sklearn.model

Saving a 'fine-tuned' bert model

青春壹個敷衍的年華 提交于 2021-01-29 00:21:49
问题 I am trying to save a fine tuned bert model. I have ran the code correctly - it works fine, and in the ipython console I am able to call getPrediction and have it result the result. I have my weight files saved (highest being model.ckpt-333.data-00000-of-00001 I have no idea how I would go about saving the model to be reuseable. I am using bert-tensorflow. import json import pandas as pd import tensorflow as tf import tensorflow_hub as hub from datetime import datetime from sklearn.model

Saving a 'fine-tuned' bert model

白昼怎懂夜的黑 提交于 2021-01-29 00:16:44
问题 I am trying to save a fine tuned bert model. I have ran the code correctly - it works fine, and in the ipython console I am able to call getPrediction and have it result the result. I have my weight files saved (highest being model.ckpt-333.data-00000-of-00001 I have no idea how I would go about saving the model to be reuseable. I am using bert-tensorflow. import json import pandas as pd import tensorflow as tf import tensorflow_hub as hub from datetime import datetime from sklearn.model

Unable to install tfcoreml (specifically coremltools)

心不动则不痛 提交于 2019-12-25 18:27:14
问题 I've tried a virtualenv, changing my python type to 2.7x, and installing it manually. However, I keep getting the error of Could not find a version that satisfies the requirement coremltools>=0.8 (from tfcoreml) (from versions: ) No matching distribution found for coremltools>=0.8 (from tfcoreml) When I search using pip search coremltools for the versions I only get coremltools (2.1.0) - Community Tools for CoreML and it still won't let me get that version. I need help. Can somebody either

Error preparing CoreML model: “<something>” is not supported for CoreML code generation

丶灬走出姿态 提交于 2019-12-24 03:42:51
问题 I am modifying the code from this tutorial and I'm getting this error: Error preparing CoreML model "Resnet50.mlmodel" for code generation: Target's predominant language "Swift Interface" is not supported for CoreML code generation. Please set COREML_CODEGEN_LANGUAGE to preferred language The project used to compile before with the "Places205-GoogLeNet" model. Anyone else experiencing the same? 回答1: In the project settings view for your app target, Change the setting COREML_CODEGEN_LANGUAGE

Prepare SKlearn model with Isolation Forest to deploy on Google Cloud

孤者浪人 提交于 2019-12-23 02:19:35
问题 I'm new to machine learning world and working on a project in which I have trained a model for fraud detection using SKlearn.I'm training the model in this way as: from sklearn.metrics import classification_report, accuracy_score from sklearn.ensemble import IsolationForest from sklearn.neighbors import LocalOutlierFactor # define a random state state = 1 # define the outlier detection method classifiers = { "Isolation Forest": IsolationForest(max_samples=len(X), contamination=outlier

How to save a trained model in Keras to use it in an application?

£可爱£侵袭症+ 提交于 2019-12-13 17:03:44
问题 I have trained a model in Keras, and saved it in different ways like; model.save("filename") or model.to_json() model.save_weights("filename") But when I load the trained model in another program to make predictions, I get very different results from the test results. Why does that happens and how can I handle that? 回答1: save it like: model.save('model.h5') model_json = model.to_json() with open("model.json", "w") as json_file: json_file.write(model_json) Then for loading it into application