vimalabs / VIMA

Official Algorithm Implementation of ICML'23 Paper "VIMA: General Robot Manipulation with Multimodal Prompts"
MIT License
778 stars 87 forks source link

problem about "post_init" #4

Closed zhanghuzhenyu closed 2 years ago

zhanghuzhenyu commented 2 years ago

Hi,

I tried to follow the example.py but met one problem. I really can't solve it,could you tell me how to do.

pybullet build time: May 20 2022 19:45:31
[INFO] 17 tasks loaded
Traceback (most recent call last):
  File "/home/vipuser/VIMA/VIMA-main/scripts/example.py", line 510, in <module>
    main(arg)
  File "/home/vipuser/anaconda3/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/vipuser/VIMA/VIMA-main/scripts/example.py", line 88, in main
    policy = create_policy_from_ckpt(cfg.ckpt, cfg.device).to(cfg.device)
  File "/home/vipuser/anaconda3/lib/python3.9/site-packages/vima/__init__.py", line 10, in create_policy_from_ckpt
    policy = Policy(**ckpt["cfg"])
  File "/home/vipuser/anaconda3/lib/python3.9/site-packages/vima/policy/policy.py", line 23, in __init__
    self.xattn_gpt = vnn.XAttnGPT(
  File "/home/vipuser/anaconda3/lib/python3.9/site-packages/vima/nn/seq_modeling/xattn_gpt/xattn_gpt.py", line 69, in __init__
    self.post_init()
  File "/home/vipuser/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1185, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'XAttnGPT' object has no attribute 'post_init'
yunfanjiang commented 2 years ago

Hey, thank you for your interest. The post_init method comes from the HuggingFace transformers package implementation. Could you please double check your installation and let me know its version?

zhanghuzhenyu commented 2 years ago

I reconfigured the environment and now the program runs normally. Thank you so much for your project, I'm enjoying using it.