xiongyiheng / prior-radgraphformer Goto Github PK
View Code? Open in Web Editor NEW[GRAIL @ MICCAI 2023] Prior-RadGraphFormer: A Prior-Knowledge-Enhanced Transformer for Generating Radiology Graphs from X-Rays
[GRAIL @ MICCAI 2023] Prior-RadGraphFormer: A Prior-Knowledge-Enhanced Transformer for Generating Radiology Graphs from X-Rays
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)?
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!
Hello,
Could you please provide some training weights of the model?
Could you provide mapping_delete_meaningless.json?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.