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

Error occurs when running IID. #2

Closed
HanbingWang2001 opened this issue Sep 28, 2023 · 3 comments
Closed

Error occurs when running IID. #2

HanbingWang2001 opened this issue Sep 28, 2023 · 3 comments

Comments

@HanbingWang2001
Copy link

Thanks for the great work!

When I am trying to run the code of IID with all requirements the same, the following error occurs:

Traceback (most recent call last):
File "/mnt/ufs18/home-246/wangh137/intRec/itemrep-master/main.py", line 844, in
mp.spawn(
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 230, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
while not context.join():
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 150, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:

-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
fn(i, *args)
File "/mnt/ufs18/home-246/wangh137/intRec/itemrep-master/main.py", line 612, in main_worker
trainer(
File "/mnt/ufs18/home-246/wangh137/intRec/itemrep-master/main.py", line 378, in trainer
) = predict_outputs(
File "/mnt/ufs18/home-246/wangh137/intRec/itemrep-master/main.py", line 85, in predict_outputs
prediction = model.module.generate(
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/transformers/generation/utils.py", line 1197, in generate
self._validate_model_kwargs(model_kwargs.copy())
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/transformers/generation/utils.py", line 1090, in _validate_model_kwargs
raise ValueError(
ValueError: The following model_kwargs are not used by the model: ['whole_word_embedding_type'] (note: typos in the generate arguments will also show up in this list)

Killing subprocess 18471
Traceback (most recent call last):
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/distributed/launch.py", line 340, in
main()
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/distributed/launch.py", line 326, in main
sigkill_handler(signal.SIGTERM, None) # not coming back
File "/mnt/home/wangh137/anaconda3/envs/itemrep/lib/python3.9/site-packages/torch/distributed/launch.py", line 301, in sigkill_handler
raise subprocess.CalledProcessError(returncode=last_return_code, cmd=cmd)
subprocess.CalledProcessError: Command '['/mnt/home/wangh137/anaconda3/envs/itemrep/bin/python', '-u', 'main.py', '--local_rank=0', '--distributed', '--multiGPU', '--task', 'beauty', '--seed', '2022', '--warmup_prop', '0.05', '--lr', '1e-3', '--clip', '1.0', '--model_type', 't5-small', '--epochs', '20', '--gpu', '0,1', '--logging_step', '1000', '--logging_dir', 'log/pretrain_t5_small_beauty_independent.log', '--model_dir', 'model/pretrain_t5_small_beauty_independent.pt', '--train_sequential_item_batch', '64', '--whole_word_embedding', 'shijie', '--item_representation', 'no_tokenization', '--data_order', 'random', '--eval_only']' returned non-zero exit status 1.

@Wenyueh
Copy link
Owner

Wenyueh commented Oct 1, 2023

Thank you for raising this up! Actually I met this problem and modified the site-packages/transformers/generation/utils.py file as following:
Screen Shot 2023-10-01 at 5 48 23 PM

Can you modify as this and see whether it works?

Thx

@HanbingWang2001
Copy link
Author

Thanks for your reply! The problem has been successfully resolved!

@Wenyueh
Copy link
Owner

Wenyueh commented Oct 4, 2023

Great to hear. Also thank you for pointing this out; I will add this info to the main page.

@Wenyueh Wenyueh closed this as completed Oct 4, 2023
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