回答編集履歴
1
誤字の修正
answer
CHANGED
@@ -8,4 +8,27 @@
|
|
8
8
|
・https://insilico-notebook.com/python-unicodedecodeerror/
|
9
9
|
・https://qiita.com/tonosamart/items/06047919121b82da6d0a
|
10
10
|
|
11
|
-
難しいならば、読み込みファイル自体をいい感じにする必要がありそうです。????♂️
|
11
|
+
難しいならば、読み込みファイル自体をいい感じにする必要がありそうです。????♂️
|
12
|
+
|
13
|
+
<追記>
|
14
|
+
以下の手順にて実際に動きましたので、ご確認いただけますと幸いです。
|
15
|
+
1. ターミナルを開く。
|
16
|
+
1. `cd desktop`を実行。
|
17
|
+
1. `curl -LO http://download.tensorflow.org/example_images/flower_photos.tgz
|
18
|
+
tar xzf flower_photos.tgz`を実行
|
19
|
+
1. `mkdir tensor-train`を実行
|
20
|
+
1. `mv ./flower_photos ./tensor-train`を実行
|
21
|
+
1. `cd tensor-train`を実行
|
22
|
+
1. `touch retrain.py`を実行
|
23
|
+
1. retrain.pyファイルを開く。
|
24
|
+
1. こちらのリンクの内容を貼り付ける。(https://raw.githubusercontent.com/tensorflow/hub/52d5066e925d345fbd54ddf98b7cadf027b69d99/examples/image_retraining/retrain.py)
|
25
|
+
1. `import tensorflow as tf` → `import tensorflow.compat.v1 as tf`へ書き換える。
|
26
|
+
1. `/tmp/` → `./tmp/`へ書き換える。
|
27
|
+
1. `pip install tensorflow`を実行
|
28
|
+
1. `pip install tensorflow_hub`を実行
|
29
|
+
1. `python retrain.py --image_dir flower_photos`を実行すると、output_graph.pbファイルが生成されました。
|
30
|
+
|
31
|
+
<参考>
|
32
|
+
・https://asukiaaa.blogspot.com/2018/07/tensorflow.html
|
33
|
+
・https://raw.githubusercontent.com/tensorflow/hub/52d5066e925d345fbd54ddf98b7cadf027b69d99/examples/image_retraining/retrain.py
|
34
|
+
・https://qiita.com/titanium0715/items/7b52d817be2b97c14dab
|