lindawangg / COVID-Net

COVID-Net Open Source Initiative
Other
1.15k stars 482 forks source link

KeyError: "The name 'keras_learning_phase:0' refers to a Tensor which does not exist #180

Open Saqueeb opened 2 years ago

Saqueeb commented 2 years ago

installed library version: tensorflow==1.15.0 cv==4.20 python==3.6.13

Description

Steps to Reproduce

tried: python train_tf.py \ --weightspath COVID-Net/COVIDNet-CXR4-A \ --metaname model.meta \ --ckptname model-18540 \ --n_classes 3 \ --trainfile COVID-Net/train_split_new.txt \ #this train file is produced during data preparation --testfile COVID-Net/test_split_new.txt \ #this test file is produced during data preparation --out_tensorname norm_dense_1/Softmax:0 \ --logit_tensorname norm_dense_1/MatMul:0

Expected behavior

KeyError: "The name 'keras_learning_phase:0' refers to a Tensor which does not exist. The operation, 'keras_learning_phase', does not exist in the graph."

Can anyone faced it? What is the reason? How do I solve it?

SamanehShamshiri commented 2 years ago

I have the same error, could you solve the problem?

Saqueeb commented 2 years ago

as far as I remember, it was due to some library version mismatch. Try creating a new Conda environment and install the requirements.txt.

Saqueeb commented 2 years ago

I used python 3.6 and lower version for opencv>4.2, you may try these.