質問編集履歴

1

エラーメッセージの追加、リンクの修正を行いました

2019/09/30 05:20

投稿

ryu1
ryu1

スコア4

test CHANGED
File without changes
test CHANGED
@@ -1,8 +1,6 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
- http://nlp.seas.harvard.edu/2018/04/03/attention.html
3
+ [こちら](http://nlp.seas.harvard.edu/2018/04/03/attention.html)の解説記事のソースコードを実行しようと試みましたができない
4
-
5
- こちらの解説記事のソースコードを実行しようと試みましたができない
6
4
 
7
5
 
8
6
 
@@ -14,11 +12,19 @@
14
12
 
15
13
  ```
16
14
 
17
- tmp_model = make_model(10, 10, 2)
15
+ Traceback (most recent call last):
18
16
 
19
- position = PositionalEncoding(d_model, dropout)
17
+ File "C:../..", line 245, in <module>
20
18
 
19
+ tmp_model = make_model(10, 10, 2)
20
+
21
+ File "C:../..", line 228, in make_model
22
+
23
+ position = PositionalEncoding(d_model, dropout)
24
+
25
+ File "C:../..", line 212, in __init__
26
+
21
- pe[:, 0::2] = torch.sin(position * div_term)
27
+ pe[:, 0::2] = torch.sin(position * div_term)
22
28
 
23
29
  RuntimeError: expected device cpu and dtype Float but got device cpu and dtype Long
24
30
 
@@ -132,13 +138,33 @@
132
138
 
133
139
  解説記事のプログラムをそのまま実行すると別のエラー(RuntimeError: exp_vml_cpu not implemented for 'Long')が出ていたので
134
140
 
141
+ ```
135
142
 
143
+ Traceback (most recent call last):
136
144
 
145
+ File "C:../..", line 245, in <module>
146
+
147
+ tmp_model = make_model(10, 10, 2)
148
+
149
+ File "C:../..", line 228, in make_model
150
+
151
+ position = PositionalEncoding(d_model, dropout)
152
+
153
+ File "C:../..", line 211, in __init__
154
+
155
+ -(math.log(10000.0) / d_model))
156
+
137
- https://discuss.pytorch.org/t/runtimeerror-exp-vml-cpu-not-implemented-for-long/49025
157
+ RuntimeError: exp_vml_cpu not implemented for 'Long'
158
+
159
+ ```
138
160
 
139
161
 
140
162
 
163
+
164
+
165
+
166
+
141
- こちらを参考に0に小数点を付けました
167
+ [こちら](https://discuss.pytorch.org/t/runtimeerror-exp-vml-cpu-not-implemented-for-long/49025)を参考に0に小数点を付けました
142
168
 
143
169
 
144
170