質問編集履歴

1

tracebackのメッセージを追加

2023/04/26 03:02

投稿

yamaguchi_ss
yamaguchi_ss

スコア0

test CHANGED
File without changes
test CHANGED
@@ -8,11 +8,48 @@
8
8
 
9
9
 
10
10
  ### 発生している問題・エラーメッセージ
11
+ RuntimeError Traceback (most recent call last)
12
+ Cell In[42], line 45
13
+ 42 print(inputs.device)
14
+ 43 device
15
+ ---> 45 outputs = net(inputs)
16
+ 46 print(outputs)
17
+
18
+ File ~/opt/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py:1501, in Module._call_impl(self, *args, **kwargs)
19
+ 1496 # If we don't have any hooks, we want to skip the rest of the logic in
20
+ 1497 # this function, and just call forward.
21
+ 1498 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
22
+ 1499 or _global_backward_pre_hooks or _global_backward_hooks
23
+ 1500 or _global_forward_hooks or _global_forward_pre_hooks):
24
+ -> 1501 return forward_call(*args, **kwargs)
25
+ 1502 # Do not call functions when jit is used
26
+ 1503 full_backward_hooks, non_full_backward_hooks = [], []
27
+
28
+ Cell In[42], line 9, in Net.forward(self, x)
29
+ 8 def forward(self, x):
30
+ ----> 9 x1 = self.l1(x)
31
+ 10 x2 = self.relu(x1)
32
+ 11 x3 = self.l2(x2)
33
+
34
+ File ~/opt/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py:1501, in Module._call_impl(self, *args, **kwargs)
35
+ 1496 # If we don't have any hooks, we want to skip the rest of the logic in
36
+ 1497 # this function, and just call forward.
37
+ 1498 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks
38
+ 1499 or _global_backward_pre_hooks or _global_backward_hooks
39
+ 1500 or _global_forward_hooks or _global_forward_pre_hooks):
40
+ -> 1501 return forward_call(*args, **kwargs)
41
+ 1502 # Do not call functions when jit is used
42
+ 1503 full_backward_hooks, non_full_backward_hooks = [], []
43
+
44
+ File ~/opt/anaconda3/lib/python3.9/site-packages/torch/nn/modules/linear.py:114, in Linear.forward(self, input)
45
+ 113 def forward(self, input: Tensor) -> Tensor:
46
+ --> 114 return F.linear(input, self.weight, self.bias)
47
+
11
- Placeholder storage has not been allocated on MPS device!
48
+ RuntimeError: Placeholder storage has not been allocated on MPS device!
12
49
 
13
50
 
14
51
  ### 該当のソースコード
15
-
52
+ """python
16
53
  !pip install japanize_matplotlib | tail -n 1
17
54
  !pip install torchviz | tail -n 1
18
55
  !pip install torchinfo | tail -n 1
@@ -84,6 +121,7 @@
84
121
 
85
122
  outputs = net(inputs)
86
123
  print(outputs)
124
+ """
87
125
 
88
126
  ### 試したこと
89
127