AlexTS1980 / COVID-CT-Mask-Net

Segmentation and Classification models for COVID CT scans (COVID, pneumonia, normal) based on Mask R-CNN.
https://github.com/AlexTS1980/COVID-CT-Mask-Net
28 stars 15 forks source link

Problems about "inference_segmentation.py" #7

Open yixuanli1230 opened 10 months ago

yixuanli1230 commented 10 months ago

Question 1: I would like to try to run the reference_segmentation.py file, but the following error occurs "RuntimeError: Can't call numpy() on Tensor that requires grad. use tensor.detach(). numpy() instead.". As shown in the image below. ![Uploading WechatIMG599.jpg…]()

Then I modified ax.add_patch(rect) to ax.add_patch(rect.detach().numpy()). But new error "AttributeError: 'Rectangle' object has no attribute 'detach'" appears. ![Uploading WechatIMG600.jpg…]()

I would like to ask how to solve this problem. The image format I am using is png.

Question 2: While segmenting the CT images, I found that there is a corresponding tasks file in both test and train datasets. How is that masks file obtained?

yixuanli1230 commented 10 months ago

solved it