residue_esm_tokens is not defined
Error:
g: Starting from v1.9.0,tensorboardXhas been removed as a dependency of thepytorch_lightningpackage, due to potential conflicts with other packages in the ML ecosystem. For this reason,logger=Truewill useCSVLoggeras the default logger, unless thetensorboardortensorboardXpackages are found. Pleasepip install lightning[extra]or one of them to enable TensorBoard support by default "Starting from v1.9.0,tensorboardXhas been removed as a dependency of thepytorch_lightning`"
Missing logger folder: workdir/inference/example_ProteinReDiff/gen5/lightning_logs
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
Predicting DataLoader 0: 0%| | 0/3 [00:00<?, ?it/s]Using cache found in /home/ubuntu/.cache/torch/hub/facebookresearch_esm_main
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/trainer/call.py", line 38, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 938, in _predict_impl
results = self._run(model, ckpt_path=self.ckpt_path)
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1112, in _run
results = self._run_stage()
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1190, in _run_stage
return self._run_predict()
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1244, in _run_predict
return self.predict_loop.run()
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py", line 199, in run
self.advance(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/loops/dataloader/prediction_loop.py", line 101, in advance
dataloader_iter, self.current_dataloader_idx, dl_max_batches, self.num_dataloaders
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py", line 199, in run
self.advance(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/prediction_epoch_loop.py", line 100, in advance
self._predict_step(batch, batch_idx, dataloader_idx)
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/prediction_epoch_loop.py", line 129, in _predict_step
predictions = self.trainer._call_strategy_hook("predict_step", *step_kwargs.values())
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1494, in _call_strategy_hook
output = fn(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/pytorch_lightning/strategies/strategy.py", line 408, in predict_step
return self.model.predict_step(*args, **kwargs)
File "/home/ubuntu/BOLTPRO/Chirag/Protein_Redesign/ProteinReDiff/model.py", line 251, in predict_step
x, seq_t = self.sample(batch)
File "/home/ubuntu/anaconda3/envs/pr_design/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/BOLTPRO/Chirag/Protein_Redesign/ProteinReDiff/model.py", line 387, in sample
batch = self.prepare_batch(batch)
File "/home/ubuntu/BOLTPRO/Chirag/Protein_Redesign/ProteinReDiff/model.py", line 443, in prepare_batch
residue_esm_tokens = batch["residue_esm_tokens"]
KeyError: 'residue_esm_tokens'
Predicting DataLoader 0: 0%| | 0/3 [00:11<?, ?it/s]
`
There is n attribute of "residue_esm_tokens" in the object "batch" Please mention the python version as well the dependencies version you are using because it is working in other deprecated version
same here
residue_esm_tokens appeared when you actually in training. Are you going through the training step?
If it is just inferencing, I just fixed the generate script (without using flag "--training" to disengage stochastic masking).
The python used is 3.9, pytorch=1.12.1, lightning=1.7.7. Those are in environment file: https://github.com/HySonLab/Protein_Redesign/blob/main/environment.yml