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

How to run the demo locally and correctly? #23

Open
ifsheldon opened this issue Apr 10, 2024 · 5 comments
Open

How to run the demo locally and correctly? #23

ifsheldon opened this issue Apr 10, 2024 · 5 comments

Comments

@ifsheldon
Copy link

Hi! I've read README and tried to run the demo on my server, but I think there're a lot of code that is out of sync or missing. And the guides are incomplete.

Here are my steps:

  1. I installed the dependencies according to INSTALL.md
  2. I ran the app.py in this repo
  3. A lot of models are missing:
    • I need GLEE models so I downloaded them on huggingface demo directory
    • Misc models are missing, then I found the ones mentioned in TRAIN.md and downloaded them
  4. There are bugs in app.py on lines like (outputs,_) = GLEEmodel(...), which should be ((outputs, _), _, _) = GLEEmodel(...)
  5. Then I ran the app.py in this repo again, but the results are just random like below.
image

Did I do anything wrong? Should I just clone the huggingface repo instead?

@knightdby
Copy link

+1

1 similar comment
@heroinlin
Copy link

+1

@heroinlin
Copy link

heroinlin commented Apr 24, 2024

@ifsheldon @knightdby
check out to huggingface repo, and it work well!
image
image

@cteant
Copy link

cteant commented May 21, 2024

The problem is that in app.py when loading the glee model, the key does not match and the model is not correctly loaded. Use the following code in L88 in app.py

GLEEmodel_r50.load_state_dict({k.replace('glee.', ''): v for k, v in checkpoints_r50.items()}, strict=False)

Also in L98 in app.py

GLEEmodel_swin.load_state_dict({k.replace('glee.', ''): v for k, v in checkpoints_swin.items()}, strict=False)

@2anchao
Copy link

2anchao commented Jun 6, 2024

The problem is that in app.py when loading the glee model, the key does not match and the model is not correctly loaded. Use the following code in L88 in app.py

GLEEmodel_r50.load_state_dict({k.replace('glee.', ''): v for k, v in checkpoints_r50.items()}, strict=False)

Also in L98 in app.py

GLEEmodel_swin.load_state_dict({k.replace('glee.', ''): v for k, v in checkpoints_swin.items()}, strict=False)

nice

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

5 participants