Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Error #213

Open
SamanehShamshiri opened this issue Feb 10, 2022 · 1 comment
Open

Runtime Error #213

SamanehShamshiri opened this issue Feb 10, 2022 · 1 comment

Comments

@SamanehShamshiri
Copy link

while I'm running the code, I got this error:
Output: ./output/COVIDNet-lr0.0002
13992 16490
Saved baseline checkpoint
Baseline eval:
[[194. 6.]
[ 9. 191.]]
Sens Negative: 0.970, Positive: 0.955
PPV Negative: 0.956, Positive: 0.970
Training started
Traceback (most recent call last):
File "train_tf.py", line 144, in
batch_x, batch_y, weights, is_training = next(generator)
File "/home/samaneh/workspace/COVID-Net-master/data.py", line 167, in next
model_inputs = self.getitem(self.n)
File "/home/samaneh/workspace/COVID-Net-master/data.py", line 219, in getitem
top_percent=self.top_percent,
File "/home/samaneh/workspace/COVID-Net-master/data.py", line 23, in process_image_file
img = crop_top(img, percent=top_percent)
File "/home/samaneh/workspace/COVID-Net-master/data.py", line 12, in crop_top
offset = int(img.shape[0] * percent)
AttributeError: 'NoneType' object has no attribute 'shape'

Although I downloaded version 3 based on #155 I still have this error.
I am using python 3.6, TensorFlow 1.15, open-cv 4.2, and running the code on Linux Manjaro.
would you please tell me how I can solve this problem?

@haydengunraj
Copy link
Collaborator

Hi @SamanehShamshiri,

The first thing to do would be to double-check that the image files exist, which you can do by printing the file path passed to cv2.imread() just before the error occurs. cv2.imread() returns None when the path it is given doesn't exist, so the error you're getting happens when this None value is treated as a NumPy array later on.

If this is a path issue, printing the file paths passed to cv2.imread() should help debug it. However, if it is an issue where the image file names in the label list are incorrect (i.e., an error on our end), that would be something we can fix. With the given information, it's impossible for me to tell which it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants