learning_model 1.0.41 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -277,10 +277,16 @@ class LearningMobilenet {
|
|
|
277
277
|
saveModel(handlerOrURL, config) {
|
|
278
278
|
var _a;
|
|
279
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
try {
|
|
281
|
+
console.log('saveModel try', this.isTrainedDone);
|
|
282
|
+
if (!this.isTrainedDone) {
|
|
283
|
+
return Promise.reject(new Error('Train is not done status'));
|
|
284
|
+
}
|
|
285
|
+
yield ((_a = this.model) === null || _a === void 0 ? void 0 : _a.save(handlerOrURL, config));
|
|
286
|
+
}
|
|
287
|
+
catch (e) {
|
|
288
|
+
console.log('saveModel Error', e);
|
|
282
289
|
}
|
|
283
|
-
yield ((_a = this.model) === null || _a === void 0 ? void 0 : _a.save(handlerOrURL, config));
|
|
284
290
|
});
|
|
285
291
|
}
|
|
286
292
|
// 진행중 여부
|
|
@@ -284,10 +284,15 @@ class LearningMobilenet implements LearningInterface {
|
|
|
284
284
|
|
|
285
285
|
// 모델 저장
|
|
286
286
|
public async saveModel(handlerOrURL: io.IOHandler | string, config?: io.SaveConfig): Promise<void> {
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
try {
|
|
288
|
+
console.log('saveModel try', this.isTrainedDone);
|
|
289
|
+
if (!this.isTrainedDone) {
|
|
290
|
+
return Promise.reject(new Error('Train is not done status'));
|
|
291
|
+
}
|
|
292
|
+
await this.model?.save(handlerOrURL, config);
|
|
293
|
+
} catch(e) {
|
|
294
|
+
console.log('saveModel Error', e);
|
|
289
295
|
}
|
|
290
|
-
await this.model?.save(handlerOrURL, config);
|
|
291
296
|
}
|
|
292
297
|
|
|
293
298
|
// 진행중 여부
|