amazon-science / patchcore-inspection

Apache License 2.0
719 stars 146 forks source link

TypeError: 'NoneType' object is not callable #14

Closed PeterKim1 closed 2 years ago

PeterKim1 commented 2 years ago

Hi. Thank you for sharing your great codes.

I try to run these codes in Google Colab environment.

But this error occurs:

Traceback (most recent call last): File "/content/drive/MyDrive/patchcore-inspection/bin/run_patchcore.py", line 34, in @main.result_callback() TypeError: 'NoneType' object is not callable

How to fix it?

Confusezius commented 2 years ago

Sorry for the late reply! Can you show me the full line you used to call the run_patchcore.py script? Ideally, it would look something like

env PYTHONPATH=src python bin/run_patchcore.py
shellxiao commented 2 years ago

Hi. Thank you for sharing your great codes.

I try to run these codes in Google Colab environment.

But this error occurs:

Traceback (most recent call last): File "/content/drive/MyDrive/patchcore-inspection/bin/run_patchcore.py", line 34, in @main.result_callback() TypeError: 'NoneType' object is not callable

How to fix it?

@PeterKim1 hello, have you solved the problem? @petergehler

petergehler commented 2 years ago

We would need more information to reproduce and understand the error. Can you paste the full command that triggers this error?

PeterKim1 commented 2 years ago

Sorry for late reply.

I'm very busy, so cannot pay attention to this.

I don't know why, but this problem is solved!

Mugunthan98 commented 1 year ago

w why, but this problem is solved!

We would need more information to reproduce and understand the error. Can you paste the full command that triggers this error?

Hi! I tried to run the code in colab and I'm getting the same error. I tried the following 3 approaches and ended up with the same error.

Approach1 !env PYTHONPATH=src python bin/run_patchcore.py

Approach2 !env PYTHONPATH=src python bin/run_patchcore.py --gpu 0 --seed 0 --save_patchcore_model --log_group IM224_WR50_L2-3_P01_D1024-1024_PS-3_AN-1_S0 --log_project MVTecAD_Results results patch_core -b wideresnet50 -le layer2 -le layer3 --pretrain_embed_dimension 1024 --target_embed_dimension 1024 --anomaly_scorer_num_nn 1 --patchsize 3 sampler -p 0.1 approx_greedy_coreset dataset --resize 256 --imagesize 224 mvtec "/content/drive/MyDrive/FYP/cs-flow/data/images/mvtec"

Approach3 datapath= "/content/drive/MyDrive/FYP/cs-flow/data/images/mvtec" dataset_flags=('-d','toothbrush')

!env PYTHONPATH=src python bin/run_patchcore.py --gpu 0 --seed 0 --save_patchcore_model \ --log_group IM224_WR50_L2-3_P01_D1024-1024_PS-3_AN-1_S0 --log_online --log_project MVTecAD_Results results \ patch_core -b wideresnet50 -le layer2 -le layer3 --faiss_on_gpu \ --pretrain_embed_dimension 1024 --target_embed_dimension 1024 --anomaly_scorer_num_nn 1 --patchsize 3 \ sampler -p 0.1 approx_greedy_coreset dataset --resize 256 --imagesize 224 "${dataset_flags[@]}" mvtec $datapath

Can you please point out where things go wrong? Thanks in advance.

Error Traceback (most recent call last): File "bin/run_patchcore.py", line 35, in @main.result_callback() TypeError: 'NoneType' object is not callable

TengliEd commented 1 year ago

@Mugunthan98 You can try to update click to version 8.0.3 by pip install click==8.0.3