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

torch.load() throws Segmentation fault (core dumped) #17

Open
BaiGeiQiShi opened this issue Jul 13, 2023 · 1 comment
Open

torch.load() throws Segmentation fault (core dumped) #17

BaiGeiQiShi opened this issue Jul 13, 2023 · 1 comment

Comments

@BaiGeiQiShi
Copy link

BaiGeiQiShi commented Jul 13, 2023

Dear author,
When I use python generator.py to generate patches, I got the Segmentation fault (core dumped). I found it was caused by torch.load().

def generate_gpt_fconv(vocab_file, model_file, input_file, identifier_txt_file, identifier_token_file, output_file, beam_size):
    dictionary = Dictionary(vocab_file, min_cnt=0)
    print(len(dictionary))
    loaded = torch.load(
            model_file, map_location="cpu"
    )

I tried map_location="cpu", map_location="cuda:0". My GPU is A5000, cuda==10.1, pytorch==1.4.0, python==3.8. The models I used are your pre-traned model.

Could you help me? Thanks in advance!

@BaiGeiQiShi
Copy link
Author

Here I found the problem:

Exception has occurred: ModuleNotFoundError
No module named 'transformers.configuration_openai'
  File "/CURE/src/tester/generator.py", line 61, in generate_gpt_conut
    loaded = torch.load(
  File "/CURE/src/tester/generator.py", line 134, in <module>
    generate_gpt_conut(vocab_file, model_file, input_file, identifier_txt_file, identifier_token_file, output_file, beam_size)
ModuleNotFoundError: No module named 'transformers.configuration_openai'

But I already used pip to install transformers=2.10.0, is there a problem with my installation?

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

1 participant