質問編集履歴

3

タイトルの変更

2023/01/18 11:52

投稿

uuuuuu
uuuuuu

スコア13

test CHANGED
@@ -1 +1 @@
1
- pytorchを用いてCNNによる2種類の画像分類を行いたいがCUDA out of memory.というエラーが出てしまう GPUメモリ不足
1
+ pytorchを用いてCNNによる2種類の画像分類を行いたいが.stack expects each tensor to be equal sizeというエラーが出てしまう 
test CHANGED
File without changes

2

tuika

2023/01/18 10:20

投稿

uuuuuu
uuuuuu

スコア13

test CHANGED
File without changes
test CHANGED
@@ -255,5 +255,7 @@
255
255
 
256
256
  メモリの確認画像
257
257
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2023-01-18/42f0c71c-b3f3-44fd-ba11-67dbb8a9a702.png)
258
-
258
+ ### 追加記載
259
-
259
+ バッチサイズを64→32に変更したところエラーが消えました。
260
+ が、違うエラーが発生しました。
261
+ RuntimeError: stack expects each tensor to be equal size, but got [3, 512, 512] at entry 0 and [3, 1095, 1280] at entry 22

1

脱字

2023/01/18 09:04

投稿

uuuuuu
uuuuuu

スコア13

test CHANGED
File without changes
test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  ### 発生している問題・エラーメッセージ
12
12
  画像の枚数を100枚:50枚→400枚:100枚(学習用:テスト用)に変更したところ以下のエラーが発生し実行ができなくなりました。
13
- 画像を増やす前は実行ができていまし
13
+ 画像を増やす前は実行ができていました。
14
14
  ```
15
15
  **CUDA out of memory. **Tried to allocate 352.00 MiB (GPU 0; 7.92 GiB total capacity;
16
16
  7.37 GiB already allocated; 107.69 MiB free; 7.43 GiB reserved in total by PyTorch)