質問編集履歴

2

画像の追加

2020/07/07 03:26

投稿

_mini
_mini

スコア15

test CHANGED
File without changes
test CHANGED
@@ -32,6 +32,12 @@
32
32
 
33
33
  ```
34
34
 
35
+
36
+
37
+ 階層は下記です。
38
+
39
+ ![イメージ説明](448f5f3643ddc08ee7e9e4434e490504.png)
40
+
35
41
  書いたコードは下記に示してあります。重みを使用する際にはtrainのところをコメントアウトして実行を試そうと思っているのですが、うまくいきません。
36
42
 
37
43
 

1

エラー文の追加

2020/07/07 03:26

投稿

_mini
_mini

スコア15

test CHANGED
File without changes
test CHANGED
@@ -6,7 +6,29 @@
6
6
 
7
7
  ```ここに言語を入力
8
8
 
9
+ (base) xxxxxxx python % /opt/anaconda3/bin/python /Users/xxxxxx/Downloads/python/pytourch_study/weights/sumple_cnn.py
10
+
11
+ test
12
+
13
+ Traceback (most recent call last):
14
+
15
+ File "/Users/xxxxxx/Downloads/python/pytourch_study/weights/sumple_cnn.py", line 98, in <module>
16
+
17
+ model.load_state_dict(torch.load("weights/weights_2.pth"))
18
+
19
+ File "/opt/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 584, in load
20
+
21
+ with _open_file_like(f, 'rb') as opened_file:
22
+
23
+ File "/opt/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 234, in _open_file_like
24
+
25
+ return _open_file(name_or_buffer, mode)
26
+
27
+ File "/opt/anaconda3/lib/python3.7/site-packages/torch/serialization.py", line 215, in __init__
28
+
29
+ super(_open_file, self).__init__(open(name, mode))
30
+
9
- FileNotFoundError: [Errno 2] No such file or directory:
31
+ FileNotFoundError: [Errno 2] No such file or directory: 'weights/weights_2.pth'
10
32
 
11
33
  ```
12
34