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 can I train VGT? #104

Open
Seoung-wook opened this issue Jan 23, 2024 · 1 comment
Open

How can I train VGT? #104

Seoung-wook opened this issue Jan 23, 2024 · 1 comment

Comments

@Seoung-wook
Copy link

In my case, I use command like below.

CUDA_VISIBLE_DEVICES=2 python train_VGT.py --config-file Configs/cascade/D4LA_VGT_cascade_PTM.yaml --num-gpus 1 MODEL.WEIGHTS ./pretrained/D4LA_VGT_model.pth OUTPUT_DIR ./trained

error accured like below.

Traceback (most recent call last):
File "/workspace/future_task/AdvancedLiterateMachinery/DocumentUnderstanding/VGT/object_detection/train_VGT.py", line 156, in
launch(
File "/home/swchoi/.conda/envs/vgt/lib/python3.9/site-packages/detectron2/engine/launch.py", line 84, in launch
main_func(*args)
File "/workspace/future_task/AdvancedLiterateMachinery/DocumentUnderstanding/VGT/object_detection/train_VGT.py", line 131, in main
trainer = MyTrainer(cfg)
File "/workspace/future_task/AdvancedLiterateMachinery/DocumentUnderstanding/VGT/object_detection/ditod/VGTTrainer.py", line 432, in init
model = self.build_model(cfg)
File "/workspace/future_task/AdvancedLiterateMachinery/DocumentUnderstanding/VGT/object_detection/ditod/VGTTrainer.py", line 571, in build_model
model = build_model(cfg)
File "/home/swchoi/.conda/envs/vgt/lib/python3.9/site-packages/detectron2/modeling/meta_arch/build.py", line 22, in build_model
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
File "/home/swchoi/.conda/envs/vgt/lib/python3.9/site-packages/detectron2/config/config.py", line 190, in wrapped
init_func(self, **explicit_args)
File "/workspace/future_task/AdvancedLiterateMachinery/DocumentUnderstanding/VGT/object_detection/ditod/VGT.py", line 48, in init
self.Wordgrid_embedding = WordnnEmbedding(vocab_size, hidden_size, embedding_dim,
File "/workspace/future_task/AdvancedLiterateMachinery/DocumentUnderstanding/VGT/object_detection/ditod/Wordnn_embedding.py", line 39, in init
self.init_weights(bros_embedding_path)
File "/workspace/future_task/AdvancedLiterateMachinery/DocumentUnderstanding/VGT/object_detection/ditod/Wordnn_embedding.py", line 47, in init_weights
state_dict = torch.load(bros_embedding_path + "pytorch_model.bin", map_location='cpu')
File "/home/swchoi/.conda/envs/vgt/lib/python3.9/site-packages/torch/serialization.py", line 699, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/swchoi/.conda/envs/vgt/lib/python3.9/site-packages/torch/serialization.py", line 231, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/swchoi/.conda/envs/vgt/lib/python3.9/site-packages/torch/serialization.py", line 212, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/path/layoutlm-base-uncased/pytorch_model.bin'

I think FileNotFoundError: [Errno 2] No such file or directory: '/path/layoutlm-base-uncased/pytorch_model.bin' caused by Wordnn_embedding.py's init_weights method.

Please answer how I can solve the problem.

@sibam23
Copy link

sibam23 commented Mar 21, 2024

I solved this issue by using git clone and downloading the layoutlm tokenizer from huggingface

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

2 participants