Giter Club home page Giter Club logo

Comments (8)

Hikaylee avatar Hikaylee commented on September 15, 2024

@YuHengsss 希望您能帮忙看一下 谢谢

from yolov.

YuHengsss avatar YuHengsss commented on September 15, 2024

hello, 这个 iteration 的某个 img 应该没读到,可以查看一下它的输入情况。 我怀疑是部分图像缺失的问题

from yolov.

Hikaylee avatar Hikaylee commented on September 15, 2024

那请问一下运行python tools/val_to_imdb.py 来验证的时候,为什么运行过程中电脑内存占用会一直在增长,每次我都还没运行完所有(555个)循环就因为内存满了导致中断
image

from yolov.

YuHengsss avatar YuHengsss commented on September 15, 2024

因为predictions 的总数太多啦,32G 的内存在我们的测试环境中有时也会炸内存

from yolov.

YuHengsss avatar YuHengsss commented on September 15, 2024

因为predictions 的总数太多啦,32G 的内存在我们的测试环境中有时也会炸内存

可以通过修改confidence threshold 或者加大内存缓解,不过前者有会有略微掉点

from yolov.

Hikaylee avatar Hikaylee commented on September 15, 2024

因为predictions 的总数太多啦,32G 的内存在我们的测试环境中有时也会炸内存

可以通过修改confidence threshold 或者加大内存缓解,不过前者有会有略微掉点

我本来尝试了每次循环都把结果用pickle.dump((res[0], res[1]), file_writter)写入,而不是最后append一次性写入,但发现这样最后得到的pickle文件大小比原来将近大了10倍,但逻辑上我没有找到问题,是因为pickle.dump会压缩数据吗?

from yolov.

YuHengsss avatar YuHengsss commented on September 15, 2024

是不是忘记转格式了?

det_repp = predictor.to_repp_heavy(pred,ratio,[height,width],image_id)

from yolov.

Hikaylee avatar Hikaylee commented on September 15, 2024

是不是忘记转格式了?

det_repp = predictor.to_repp_heavy(pred,ratio,[height,width],image_id)

别的地方都没变,就只在最后改了一下写入的顺序:
for ele in res:
cur_iter += 1
if cur_iter % 10 == 0:
print(str(cur_iter) + '/' + str(len(res)))
first_frame = ele[0][0]
video_name = first_frame[first_frame.find('val'):first_frame.rfind('/')]

    preds_video = {}
    **repp_res = []**
    for frames in ele:
        # frames
        if frames == []: continue
        tmp_imgs = []
        for img in frames:
            img = cv2.imread(os.path.join(exp.data_dir, img))
            height, width = img.shape[:2]
            ratio = min(predictor.test_size[0] / img.shape[0], predictor.test_size[1] / img.shape[1])
            img, _ = predictor.preproc(img, None, predictor.test_size)
            img = torch.from_numpy(img)
            tmp_imgs.append(img)
        imgs = torch.stack(tmp_imgs)    
        
        pred_res = predictor.inference(imgs)
        del imgs
        for pred, img_name in zip(pred_res, frames):
            point_idx = img_name.rfind('.')
            image_id = img_name[img_name.find('val'):point_idx]
            img_idx = img_name[img_name.rfind('/') + 1:point_idx]
            det_repp = predictor.to_repp_heavy(pred, ratio, [height, width], image_id)
            preds_video[img_idx] = det_repp
    **repp_res = [video_name, preds_video]
    pickle.dump((repp_res [0], repp_res [1]), file_writter)
file_writter.close()**

from yolov.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.