Giter Site home page Giter Site logo

xiongyiheng / prior-radgraphformer Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 17.59 MB

[GRAIL @ MICCAI 2023] Prior-RadGraphFormer: A Prior-Knowledge-Enhanced Transformer for Generating Radiology Graphs from X-Rays

Python 77.04% Shell 0.20% C++ 2.06% Cuda 20.70%

prior-radgraphformer's People

Contributors

tumvink avatar xiongyiheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tumvink

prior-radgraphformer's Issues

Loading checkpoint weights

Hello,
I am trying to perform inference for an image tensor using the checkpoint weights you provided. My code can be reduced to this

from models.relationformer_2D import build_relationformer as build_model

with open(config_file) as f:
config = yaml.load(f, Loader=yaml.FullLoader)
config = dict2obj(config)

model = build_model(config)

checkpoint = torch.load(checkpoint_path, map_location='cpu')
model.load_state_dict(checkpoint)

img_tensor = torch.load(img_tensor_path)
with torch.no_grad():
output = model(img_tensor)

However, I am getting this error:

Traceback (most recent call last):
File "my_inference.py", line 65, in
main()
File "my_inference.py", line 56, in main
model = load_checkpoint(model, args.checkpoint)
File "my_inference.py", line 41, in load_checkpoint
model.load_state_dict(checkpoint)
File "C:\Users\josen\anaconda3\envs\pradgraph\lib\site-packages\torch\nn\modules\module.py", line 1604, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for RelationFormer:
Missing key(s) in state_dict: "backbone.0.body.conv0.weight"(...) "input_proj.3.1.bias".
Unexpected key(s) in state_dict: "net", "optimizer", "scheduler".

How do you recommend loading the weights and performing inference (if I understood the code correctly, inference.py already takes the model outputs(embeddings) as inputs)?

Intention of Converting Entities in RadGraph into Non-sensitive Numbers

Hi, I have a question about the code in preprocessing of RadGraph. What's the intention of converting all entities' names into non-sensitive numbers? I am also working on the same dataset and wondering if there are some special concerns.

Thank you and look forward to hearing from you!

Training weights

Hello,
Could you please provide some training weights of the model?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.