zldrobit / pycudasift

A CUDA implementation of SIFT for NVidia GPUs
MIT License
2 stars 2 forks source link

safeCall() Runtime API error in file <cudaSiftH.cu>, line 65 : out of memory. #2

Closed GrayScaleHY closed 2 years ago

GrayScaleHY commented 2 years ago

对于一些图片会报safeCall() Runtime API error in file , line 65 : out of memory.错误。执行以下代码能复现错误:

import cv2
import cudasift
import numpy as np

img = cv2.imread("wrong_img.png", cv2.IMREAD_GRAYSCALE)

sift_data = cudasift.PySiftData(25000)
numOctaves = 5;   # /* Number of octaves in Gaussian pyramid */
initBlur = 1.6;  # /* Amount of initial Gaussian blurring in standard deviations */
thresh = 2;    # 3.5 /* Threshold on difference of Gaussians for feature pruning */
minScale = 0.0;  # /* Minimum acceptable scale to remove fine-scale features */
upScale = True;  # /* Whether to upscale image before extraction */
cudasift.ExtractKeypoints(img, sift_data, numOctaves, initBlur, thresh, minScale, upScale)
df, feat = sift_data.to_data_frame()

“wrong_img.png"为 wrong_img.zip

GrayScaleHY commented 2 years ago

经验证是图片太大导致的,当图片分辨率大于45,000,000时,会报out of memory错误。