質問するログイン新規登録

質問編集履歴

3

文章修正

2019/09/27 09:11

投稿

dream-20xx
dream-20xx

スコア17

title CHANGED
File without changes
body CHANGED
@@ -7,7 +7,7 @@
7
7
  aの配列が1以上のときはbの配列の値にし、aの配列が0のときは0にするという処理です。
8
8
  np.whereのところでメモリエラーが発生いたします。
9
9
 
10
- 万事休すの状態です。大変お手数ですが、ご回答頂けると助かります。
10
+ 大変お手数ですが、ご回答頂けると助かります。
11
11
 
12
12
  # 試したこと
13
13
  OpenCVに変更して試してみましたが、同じくメモリエラーとなりました。

2

ソース修正

2019/09/27 09:10

投稿

dream-20xx
dream-20xx

スコア17

title CHANGED
File without changes
body CHANGED
@@ -19,8 +19,8 @@
19
19
  import numpy as np
20
20
 
21
21
  np.random.seed(0)
22
- a = np.round(np.random.rand(20000, 20000) * 10)
22
+ a = np.round(np.random.rand(50000, 50000) * 10)
23
- b = np.round(np.random.rand(20000, 20000) * 10)
23
+ b = np.round(np.random.rand(50000, 50000) * 10)
24
24
 
25
25
  b = np.where(a >= 1, b, 0) # ここで「MemoryError」
26
26
  ```
@@ -31,8 +31,8 @@
31
31
  import cv2
32
32
 
33
33
  np.random.seed(0)
34
- a = np.round(np.random.rand(20000, 20000) * 10)
34
+ a = np.round(np.random.rand(50000, 50000) * 10)
35
- b = np.round(np.random.rand(20000, 20000) * 10)
35
+ b = np.round(np.random.rand(50000, 50000) * 10)
36
36
 
37
37
  ret, a = cv2.threshold(a, 1, 1, cv2.THRESH_BINARY) # ここで「cv::OutOfMemoryError」
38
38
  b = a * b

1

文章修正

2019/09/27 08:44

投稿

dream-20xx
dream-20xx

スコア17

title CHANGED
File without changes
body CHANGED
@@ -26,7 +26,7 @@
26
26
  ```
27
27
 
28
28
  # サンプルコード(OpenCV)
29
- ```Cython
29
+ ```Python
30
30
  import numpy as np
31
31
  import cv2
32
32