f4503bb3a3be014b452f54d8e2d187bb6419f627,autokeras/classifier.py,ImageClassifier,predict,#ImageClassifier#Any#,216
Before Change
An numpy.ndarray containing the results.
if constant.LIMIT_MEMORY:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
init = tf.global_variables_initializer()
sess.run(init)
backend.set_session(sess)
x_test = x_test.astype("float32") / 255
After Change
Returns:
An numpy.ndarray containing the results.
if constant.LIMIT_MEMORY:
// TODO: limit pytorch memory.
pass
test_data = self.data_transformer.transform_test(x_test)
test_loader = DataLoader(test_data, batch_size=constant.MAX_BATCH_SIZE, shuffle=True)
model = self.load_searcher().load_best_model().produce_model()
model.eval()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: keras-team/autokeras
Commit Name: f4503bb3a3be014b452f54d8e2d187bb6419f627
Time: 2018-08-01
Author: jhfjhfj1@gmail.com
File Name: autokeras/classifier.py
Class Name: ImageClassifier
Method Name: predict
Project Name: tensorlayer/tensorlayer
Commit Name: 69d9220f450db20ce2e43a7c7f095b4d891565cc
Time: 2019-04-17
Author: rundi_wu@pku.edu.cn
File Name: tensorlayer/utils.py
Class Name:
Method Name: set_gpu_fraction
Project Name: hanxiao/bert-as-service
Commit Name: 39811901eb6e63a5223a3a0f5306f4b3b23e63dd
Time: 2018-12-10
Author: hanhxiao@tencent.com
File Name: server/bert_serving/server/__init__.py
Class Name: BertWorker
Method Name: __init__