質問編集履歴
2
情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
-
model = load_model('s
|
25
|
+
model = load_model('keras-mnist-model.h5')
|
26
26
|
|
27
27
|
```
|
28
28
|
|
@@ -106,7 +106,7 @@
|
|
106
106
|
|
107
107
|
|
108
108
|
|
109
|
-
![イメージ説明](
|
109
|
+
![イメージ説明](6698bda341f869ed583b2cceb32e29e6.png)
|
110
110
|
|
111
111
|
|
112
112
|
|
1
補足
test
CHANGED
File without changes
|
test
CHANGED
@@ -60,11 +60,57 @@
|
|
60
60
|
|
61
61
|
```
|
62
62
|
|
63
|
+
また、学習済みモデルをダウンロードし、jupyternotebookで試みましたが以下のエラーが出ました。
|
64
|
+
|
65
|
+
```python
|
66
|
+
|
67
|
+
import tensorflow as tf
|
68
|
+
|
69
|
+
from tensorflow import keras
|
70
|
+
|
71
|
+
import numpy as np
|
72
|
+
|
73
|
+
from keras.models import load_model
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
model = load_model("/Users/haru/Downloads/keras-mnist-model.h5")
|
78
|
+
|
79
|
+
```
|
80
|
+
|
81
|
+
エラー内容
|
82
|
+
|
83
|
+
```python
|
84
|
+
|
85
|
+
---------------------------------------------------------------------------
|
86
|
+
|
87
|
+
AttributeError Traceback (most recent call last)
|
88
|
+
|
89
|
+
<ipython-input-13-5a0a860415ea> in <module>
|
90
|
+
|
91
|
+
----> 1 model = load_model("/Users/haru/Downloads/keras-mnist-model.h5")
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
/usr/local/Caskroom/miniforge/base/envs/python38/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py in load_model(filepath, custom_objects, compile, options)
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
/usr/local/Caskroom/miniforge/base/envs/python38/lib/python3.8/site-packages/tensorflow/python/keras/saving/hdf5_format.py in load_model_from_hdf5(filepath, custom_objects, compile)
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
AttributeError: 'str' object has no attribute 'decode'
|
104
|
+
|
105
|
+
```
|
106
|
+
|
63
107
|
|
64
108
|
|
65
109
|
![イメージ説明](fbe3a884f041d451cae2d7b6af6abfd7.png)
|
66
110
|
|
67
111
|
|
112
|
+
|
113
|
+
googlecolabの環境
|
68
114
|
|
69
115
|
keras2.5.0
|
70
116
|
|
@@ -72,6 +118,18 @@
|
|
72
118
|
|
73
119
|
numpy1.19.5
|
74
120
|
|
75
|
-
macOSX
|
76
121
|
|
122
|
+
|
123
|
+
jupyternotebookの環境
|
124
|
+
|
125
|
+
tensorflow2.4.0-rc0
|
126
|
+
|
127
|
+
keras2.4.0
|
128
|
+
|
77
|
-
|
129
|
+
numpy1.21.1
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
macOSXを利用
|