tensorflow / tpu

Reference models and tools for Cloud TPUs.
https://cloud.google.com/tpu/
Apache License 2.0
5.21k stars 1.77k forks source link

Can't run Fashionpedia inference #849

Open SikandAlex opened 3 years ago

SikandAlex commented 3 years ago

@KMnP @mitraavi @richardaecn

When trying to run inference for Fashionpedia

ImportError: cannot import name 'mode_keys' from 'dataloader' (/Users/alex/fashionpedia-demo/tpu/models/official/detection/projects/fashionpedia/dataloader/__init__.py)

I know that this has to do with adding to the PYTHONPATH as I have seen in other issues. I really don't understand what's going on because I am sure I am adding the top-level /modelsdirectory.

Clearly the program is trying to import the dataloader module from /tpu/models/official/detection/projects/fashionpedia/dataloader

but SHOULD be importing the module from

/tpu/models/official/detection/dataloader (which actually contains mode_keys.py).

The same is true for several other modules that exist in both /tpu/models/official/detection and /tpu/models/official/detection/projects/fashionpedia

How can I resolve this? I've been tearing my hair out over this. If anyone has been able to perform inference can they please share their exact steps. Thanks!

SikandAlex commented 3 years ago

Now I'm getting the following after moving past the PYTHONPATH issue.

Key fast_rcnn_head/fc7/bias not found in checkpoint Key resnet101/batch_normalization/beta not found in checkpoint

Second error is confusing because I'm trying to use the Resnet50-FPN model. I can confirm that I have downloaded both the checkpoint and config file and label map properly.

SikandAlex commented 3 years ago

If I try to specify --model attribute_mask_rcnn in the command line I get the following error.

https://github.com/tensorflow/tpu/issue_comments/687206608_

bislara commented 3 years ago

@KMnP @mitraavi @richardaecn

When trying to run inference for Fashionpedia

ImportError: cannot import name 'mode_keys' from 'dataloader' (/Users/alex/fashionpedia-demo/tpu/models/official/detection/projects/fashionpedia/dataloader/__init__.py)

I know that this has to do with adding to the PYTHONPATH as I have seen in other issues. I really don't understand what's going on because I am sure I am adding the top-level /modelsdirectory.

Clearly the program is trying to import the dataloader module from /tpu/models/official/detection/projects/fashionpedia/dataloader

but SHOULD be importing the module from

/tpu/models/official/detection/dataloader (which actually contains mode_keys.py).

The same is true for several other modules that exist in both /tpu/models/official/detection and /tpu/models/official/detection/projects/fashionpedia

How can I resolve this? I've been tearing my hair out over this. If anyone has been able to perform inference can they please share their exact steps. Thanks!

@SikandAlex Hey, can you please explain how u solved the PYTHONPATH error? I am getting the same error now.

kilarinikhil commented 3 years ago

Any solution? I am facing the same issue!

SikandAlex commented 3 years ago

@kilarinikhil

I solved this several weeks ago but to be honest it might take me time to create step by step instructions for fixing this.

Unfortunately with a bunch of AI research, the results are not reproducible or the demo/inference takes extreme pain and debugging to try to setup.

@bislara you need to add the models, models/official, and model/detection paths to PYTHONPATH I believe

hosnasattar commented 3 years ago

I have similar issue also! :-(