text:
dynamic model/dataset selection is not working

for some reason in my python environment class method function don't see global variable.
Any advice how it can be fixed without changing code will be appreciated.
I have rewritten it using more straightforward "hack"
class ModelInterface:
@classmethod
def init_model(cls, model_py_path: str, **kwargs):
sub_dirs = model_py_path.split(os.sep)
module_name = '.'.join(sub_dirs[:])
module = importlib.import_module(module_name)
objs = dir(module)
model_cls = getattr(module,objs[1])
#"EsmRegressionModel")
return model_cls(**kwargs)

Could you please give a complete error information? So I can figure out what is wrong with the code or your environment.

I have git clone SaProt again
cd SaProt
export PYTHONPATH=. (it looks like it is the FIX)
copy SaProt_650M_AF2 to  weights/PLMs
copy Thermostability to ./LMDB
and run
python scripts/training.py -c config/Thermostability/saprot.yaml
last error now
TypeError: optimizer_step() takes from 4 to 8 positional arguments but 9 were given
1,305.768 Total estimated model params size (MB)
Epoch 0:   0%|                                                                                | 0/3166 [00:00<?, ?it/s]/opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:363: LightningDeprecationWarning: The NVIDIA/apex AMP implementation has been deprecated upstream. Consequently, its integration inside PyTorch Lightning has been deprecated in v1.9.0 and will be removed in v2.0.0. The EsmRegressionModel.optimizer_step() hook is overridden, including the using_native_amp argument. Removing this argument will avoid this message, you can expect it to return True.
"The NVIDIA/apex AMP implementation has been deprecated upstream. Consequently, its integration inside"
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/tolstoy/SaProt/scripts/training.py:73 in                                           │
│                                                                                │
│   70                                                                                │
│   71                                                                                │
│   72 if name == 'main':                                                                  │
│ ❱ 73 │   main(get_args())                                                                        │
│   74                                                                                │
│                                                                                │
│ /home/tolstoy/SaProt/scripts/training.py:69 in main                                              │
│                                                                                │
│   66 │   if config.setting.os_environ.NODE_RANK != 0:                                            │
│   67 │   │   config.Trainer.logger = False                                                       │
│   68 │                                                                                │
│ ❱ 69 │   run(config)                                                                             │
│   70                                                                                │
│   71                                                                                │
│   72 if name == 'main':                                                                  │
│                                                                                │
│ /home/tolstoy/SaProt/scripts/training.py:28 in run                                               │
│                                                                                │
│   25 │   trainer = load_trainer(config)                                                          │
│   26 │                                                                                │
│   27 │   # Train and validate                                                                    │
│ ❱ 28 │   trainer.fit(model=model, datamodule=data_module)                                        │
│   29 │                                                                                │
│   30 │   # Load best model and test performance                                                  │
│   31 │   if model.save_path is not None:                                                         │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:609 in fit           │
│                                                                                │
│    606 │   │   model = self._maybe_unwrap_optimized(model)                                       │
│    607 │   │   self.strategy._lightning_module = model                                           │
│    608 │   │   call._call_and_handle_interrupt(                                                  │
│ ❱  609 │   │   │   self, self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule,  │
│    610 │   │   )                                                                                │
│    611 │                                                                                │
│    612 │   def _fit_impl(                                                                        │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/call.py:36 in                   │
│ _call_and_handle_interrupt                                                                       │
│                                                                                │
│   33 │   """                                                                                │
│   34 │   try:                                                                                │
│   35 │   │   if trainer.strategy.launcher is not None:                                           │
│ ❱ 36 │   │   │   return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer,     │
│   37 │   │   else:                                                                               │
│   38 │   │   │   return trainer_fn(*args, **kwargs)                                              │
│   39                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/strategies/launchers/subprocess_script. │
│ py:88 in launch                                                                                │
│                                                                                │
│    85 │   │   """                                                                                │
│    86 │   │   if not self.cluster_environment.creates_processes_externally:                      │
│    87 │   │   │   self._call_children_scripts()                                                  │
│ ❱  88 │   │   return function(*args, **kwargs)                                                   │
│    89 │                                                                                │
│    90 │   def _call_children_scripts(self) -> None:                                              │
│    91 │   │   # bookkeeping of spawned processes                                                 │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:650 in _fit_impl     │
│                                                                                │
│    647 │   │   │   model_provided=True,                                                          │
│    648 │   │   │   model_connected=self.lightning_module is not None,                            │
│    649 │   │   )                                                                                │
│ ❱  650 │   │   self._run(model, ckpt_path=self.ckpt_path)                                        │
│    651 │   │                                                                                │
│    652 │   │   assert self.state.stopped                                                         │
│    653 │   │   self.training = False                                                             │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1112 in _run         │
│                                                                                │
│   1109 │   │                                                                                │
│   1110 │   │   self._checkpoint_connector.resume_end()                                           │
│   1111 │   │                                                                                │
│ ❱ 1112 │   │   results = self._run_stage()                                                       │
│   1113 │   │                                                                                │
│   1114 │   │   log.detail(f"{self.class.name}: trainer tearing down")                    │
│   1115 │   │   self._teardown()                                                                  │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1191 in _run_stage   │
│                                                                                │
│   1188 │   │   │   return self._run_evaluate()                                                   │
│   1189 │   │   if self.predicting:                                                               │
│   1190 │   │   │   return self._run_predict()                                                    │
│ ❱ 1191 │   │   self._run_train()                                                                 │
│   1192 │                                                                                │
│   1193 │   def _pre_training_routine(self) -> None:                                              │
│   1194 │   │   # wait for all to join if on distributed                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1214 in _run_train   │
│                                                                                │
│   1211 │   │   self.fit_loop.trainer = self                                                      │
│   1212 │   │                                                                                │
│   1213 │   │   with torch.autograd.set_detect_anomaly(self._detect_anomaly):                     │
│ ❱ 1214 │   │   │   self.fit_loop.run()                                                           │
│   1215 │                                                                                │
│   1216 │   def _run_evaluate(self) -> _EVALUATE_OUTPUT:                                          │
│   1217 │   │   assert self.evaluating                                                            │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/fit_loop.py:267 in advance        │
│                                                                                │
│   264 │   │   assert self._data_fetcher is not None                                              │
│   265 │   │   self._data_fetcher.setup(dataloader, batch_to_device=batch_to_device)              │
│   266 │   │   with self.trainer.profiler.profile("run_training_epoch"):                          │
│ ❱ 267 │   │   │   self._outputs = self.epoch_loop.run(self._data_fetcher)                        │
│   268 │                                                                                │
│   269 │   def on_advance_end(self) -> None:                                                      │
│   270 │   │   # inform logger the batch loop has finished                                        │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py:213  │
│ in advance                                                                                │
│                                                                                │
│   210 │   │   │   self.batch_progress.increment_started()                                        │
│   211 │   │   │                                                                                │
│   212 │   │   │   with self.trainer.profiler.profile("run_training_batch"):                      │
│ ❱ 213 │   │   │   │   batch_output = self.batch_loop.run(kwargs)                                 │
│   214 │   │                                                                                │
│   215 │   │   self.batch_progress.increment_processed()                                          │
│   216                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/batch/training_batch_loop.py:88   │
│ in advance                                                                                │
│                                                                                │
│    85 │   │   │   optimizers = _get_active_optimizers(                                           │
│    86 │   │   │   │   self.trainer.optimizers, self.trainer.optimizer_frequencies, kwargs.get(   │
│    87 │   │   │   )                                                                              │
│ ❱  88 │   │   │   outputs = self.optimizer_loop.run(optimizers, kwargs)                          │
│    89 │   │   else:                                                                              │
│    90 │   │   │   outputs = self.manual_loop.run(kwargs)                                         │
│    91 │   │   if outputs:                                                                        │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:20 │
│ 2 in advance                                                                                │
│                                                                                │
│   199 │   def advance(self, optimizers: List[Tuple[int, Optimizer]], kwargs: OrderedDict) -> N   │
│   200 │   │   kwargs = self._build_kwargs(kwargs, self.optimizer_idx, self._hiddens)             │
│   201 │   │                                                                                │
│ ❱ 202 │   │   result = self._run_optimization(kwargs, self._optimizers[self.optim_progress.opt   │
│   203 │   │   if result.loss is not None:                                                        │
│   204 │   │   │   # automatic optimization assumes a loss needs to be returned for extras to b   │
│   205 │   │   │   # would be skipped otherwise                                                   │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:24 │
│ 9 in _run_optimization                                                                           │
│                                                                                │
│   246 │   │   # gradient update with accumulated gradients                                       │
│   247 │   │   else:                                                                              │
│   248 │   │   │   # the batch_idx is optional with inter-batch parallelism                     │
│ ❱ 249 │   │   │   self._optimizer_step(optimizer, opt_idx, kwargs.get("batch_idx", 0), closure   │
│   250 │   │                                                                                │
│   251 │   │   result = closure.consume_result()                                                  │
│   252                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:37 │
│ 9 in _optimizer_step                                                                             │
│                                                                                │
│   376 │   │   │   train_step_and_backward_closure,                                               │
│   377 │   │   │   on_tpu=isinstance(self.trainer.accelerator, TPUAccelerator),                   │
│   378 │   │   │   **kwargs,  # type: ignore[arg-type]                                            │
│ ❱ 379 │   │   │   using_lbfgs=is_lbfgs,                                                          │
│   380 │   │   )                                                                                │
│   381 │   │                                                                                │
│   382 │   │   if not should_accumulate:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1356 in              │
│ _call_lightning_module_hook                                                                      │
│                                                                                │
│   1353 │   │   pl_module._current_fx_name = hook_name                                            │
│   1354 │   │                                                                                │
│   1355 │   │   with self.profiler.profile(f"[LightningModule]{pl_module.class.name}.{ho  │
│ ❱ 1356 │   │   │   output = fn(*args, **kwargs)                                                  │
│   1357 │   │                                                                                │
│   1358 │   │   # restore current_fx when nested context                                          │
│   1359 │   │   pl_module._current_fx_name = prev_fx_name                                         │
│                                                                                │
│ /home/tolstoy/SaProt/model/abstract_model.py:135 in optimizer_step                               │
│                                                                                │
│   132 │   │   using_lbfgs: bool = False,                                                         │
│   133 │   ) -> None:                                                                             │
│   134 │   │   super().optimizer_step(                                                            │
│ ❱ 135 │   │   │   epoch, batch_idx, optimizer, optimizer_idx, optimizer_closure, on_tpu, using   │
│   136 │   │   )                                                                                │
│   137 │   │   self.step += 1                                                                     │
│   138                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: optimizer_step() takes from 4 to 8 positional arguments but 9 were given
Epoch 0:   0%|          | 0/3166 [00:03<?, ?it/s]

I think, issue can be closed.
I have installed correct version of pytorch-lightning
pip install pytorch-lightning==1.8.3
and now I have problem which is out of your scope
OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 15.78 GiB total capacity; 14.55 GiB already allocated; 16.44 MiB free; 14.72 GiB reserved
in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and
PYTORCH_CUDA_ALLOC_CONF
Epoch 0:   0%|          | 1/3166 [00:14<12:29:38, 14.21s/it, loss=0.167]

Sure! You can change the hyper-parameters in the config file:

If you have any question, feel free to raise an issue again!

Our model has 650M parameters so I guess even 16GB is not enough for full fine-tuning. Maybe you can try to freeze previous part of the backbone.

I have added freeze_backbone=True with attempt reduce memory consumption as you suggested.
now it report
RuntimeError: Predictions and targets are expected to have the same shape
Epoch 0:   0%|          | 0/3166 [00:04<?, ?it/s]
class EsmRegressionModel(EsmBaseModel):
def init(self, test_result_path: str = None, **kwargs):
"""
Args:
test_result_path: path to save test result
**kwargs: other arguments for EsmBaseModel
"""
self.test_result_path = test_result_path
super().init(task="regression", freeze_backbone=True, **kwargs)
#was         super().init(task="regression", **kwargs)
can you, please provide more info about backbone freeze?  How  I can do it.

it is working now.

next error: full log.
python scripts/training.py -c config/Thermostability/saprot.yaml
Some weights of the model checkpoint at weights/PLMs/SaProt_650M_AF2 were not used when initializing EsmForSequenceClassification: ['lm_head.dense.bias', 'lm_head.dense.weight', 'lm_head.layer_norm.bias', 'lm_head.bias', 'lm_head.decoder.weight', 'lm_head.layer_norm.weight']

This IS expected if you are initializing EsmForSequenceClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
This IS NOT expected if you are initializing EsmForSequenceClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of EsmForSequenceClassification were not initialized from the model checkpoint at weights/PLMs/SaProt_650M_AF2 and are newly initialized: ['esm.contact_head.regression.weight', 'esm.embeddings.position_embeddings.weight', 'classifier.out_proj.weight', 'esm.contact_head.regression.bias', 'classifier.dense.bias', 'classifier.out_proj.bias', 'classifier.dense.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
/opt/conda/lib/python3.7/site-packages/torchmetrics/utilities/prints.py:36: UserWarning: Metric SpearmanCorrcoef will save all targets and predictions in the buffer. For large datasets, this may lead to large memory footprint.
warnings.warn(*args, **kwargs)
Using 16bit native Automatic Mixed Precision (AMP)
GPU available: True (cuda), used: True
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/lightning_lite/accelerators/tpu.py", line 79, in _inner_f
queue.put(func(*args, **kwargs))
File "/opt/conda/lib/python3.7/site-packages/lightning_lite/accelerators/tpu.py", line 110, in _is_device_tpu
import torch_xla.core.xla_model as xm
File "/opt/conda/lib/python3.7/site-packages/torch_xla/init.py", line 101, in
import _XLAC
ImportError: /opt/conda/lib/python3.7/site-packages/_XLAC.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK3c104impl13OperatorEntry20reportSignatureErrorENS0_12CppSignatureE
TPU available: None, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
Initializing distributed: GLOBAL_RANK: 0, MEMBER: 1/1

distributed_backend=nccl
All distributed processes registered. Starting with 1 processes
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0,1,2,3,4,5,6,7]
| Name           | Type                         | Params
0  | model          | EsmForSequenceClassification | 652 M
1  | train_loss     | MeanSquaredError             | 0
2  | train_spearman | SpearmanCorrCoef             | 0
3  | train_R2       | R2Score                      | 0
4  | train_pearson  | PearsonCorrCoef              | 0
5  | valid_loss     | MeanSquaredError             | 0
6  | valid_spearman | SpearmanCorrCoef             | 0
7  | valid_R2       | R2Score                      | 0
8  | valid_pearson  | PearsonCorrCoef              | 0
9  | test_loss      | MeanSquaredError             | 0
10 | test_spearman  | SpearmanCorrCoef             | 0
11 | test_R2        | R2Score                      | 0
12 | test_pearson   | PearsonCorrCoef              | 0
1.6 M     Trainable params
651 M     Non-trainable params
652 M     Total params
1,305.768 Total estimated model params size (MB)
Epoch 0:   0%|                                                                                | 0/3166 [00:00<?, ?it/s][W reducer.cpp:1298] Warning: find_unused_parameters=True was specified in DDP constructor, but did not find any unused parameters in the forward pass. This flag results in an extra traversal of the autograd graph every iteration,  which can adversely affect performance. If your model indeed never has any unused parameters in the forward pass, consider turning this flag off. Note that this warning may be a false positive if your model has flow control causing later iterations to have unused parameters. (function operator())
Epoch 0:  90%|█████████████████████████████████████████████████████████████████████████▋        | 2845/3166 [05:53<00:39,  8.04it/s, loss=0.0267]╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/tolstoy/SaProt/scripts/training.py:73 in                                           │
│                                                                                │
│   70                                                                                │
│   71                                                                                │
│   72 if name == 'main':                                                                  │
│ ❱ 73 │   main(get_args())                                                                        │
│   74                                                                                │
│                                                                                │
│ /home/tolstoy/SaProt/scripts/training.py:69 in main                                              │
│                                                                                │
│   66 │   if config.setting.os_environ.NODE_RANK != 0:                                            │
│   67 │   │   config.Trainer.logger = False                                                       │
│   68 │                                                                                │
│ ❱ 69 │   run(config)                                                                             │
│   70                                                                                │
│   71                                                                                │
│   72 if name == 'main':                                                                  │
│                                                                                │
│ /home/tolstoy/SaProt/scripts/training.py:28 in run                                               │
│                                                                                │
│   25 │   trainer = load_trainer(config)                                                          │
│   26 │                                                                                │
│   27 │   # Train and validate                                                                    │
│ ❱ 28 │   trainer.fit(model=model, datamodule=data_module)                                        │
│   29 │                                                                                │
│   30 │   # Load best model and test performance                                                  │
│   31 │   if model.save_path is not None:                                                         │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:583 in fit           │
│                                                                                │
│    580 │   │   │   raise TypeError(f"Trainer.fit() requires a LightningModule, got: {model.  │
│    581 │   │   self.strategy._lightning_module = model                                           │
│    582 │   │   call._call_and_handle_interrupt(                                                  │
│ ❱  583 │   │   │   self, self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule,  │
│    584 │   │   )                                                                                │
│    585 │                                                                                │
│    586 │   def _fit_impl(                                                                        │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/call.py:36 in                   │
│ _call_and_handle_interrupt                                                                       │
│                                                                                │
│   33 │   """                                                                                │
│   34 │   try:                                                                                │
│   35 │   │   if trainer.strategy.launcher is not None:                                           │
│ ❱ 36 │   │   │   return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer,     │
│   37 │   │   else:                                                                               │
│   38 │   │   │   return trainer_fn(*args, **kwargs)                                              │
│   39                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/strategies/launchers/subprocess_script. │
│ py:90 in launch                                                                                │
│                                                                                │
│    87 │   │   """                                                                                │
│    88 │   │   if not self.cluster_environment.creates_processes_externally:                      │
│    89 │   │   │   self._call_children_scripts()                                                  │
│ ❱  90 │   │   return function(*args, **kwargs)                                                   │
│    91 │                                                                                │
│    92 │   def _call_children_scripts(self) -> None:                                              │
│    93 │   │   # bookkeeping of spawned processes                                                 │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:624 in _fit_impl     │
│                                                                                │
│    621 │   │   │   model_provided=True,                                                          │
│    622 │   │   │   model_connected=self.lightning_module is not None,                            │
│    623 │   │   )                                                                                │
│ ❱  624 │   │   self._run(model, ckpt_path=self.ckpt_path)                                        │
│    625 │   │                                                                                │
│    626 │   │   assert self.state.stopped                                                         │
│    627 │   │   self.training = False                                                             │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1061 in _run         │
│                                                                                │
│   1058 │   │                                                                                │
│   1059 │   │   self._checkpoint_connector.resume_end()                                           │
│   1060 │   │                                                                                │
│ ❱ 1061 │   │   results = self._run_stage()                                                       │
│   1062 │   │                                                                                │
│   1063 │   │   log.detail(f"{self.class.name}: trainer tearing down")                    │
│   1064 │   │   self._teardown()                                                                  │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1140 in _run_stage   │
│                                                                                │
│   1137 │   │   │   return self._run_evaluate()                                                   │
│   1138 │   │   if self.predicting:                                                               │
│   1139 │   │   │   return self._run_predict()                                                    │
│ ❱ 1140 │   │   self._run_train()                                                                 │
│   1141 │                                                                                │
│   1142 │   def _pre_training_routine(self) -> None:                                              │
│   1143 │   │   # wait for all to join if on distributed                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1163 in _run_train   │
│                                                                                │
│   1160 │   │   self.fit_loop.trainer = self                                                      │
│   1161 │   │                                                                                │
│   1162 │   │   with torch.autograd.set_detect_anomaly(self._detect_anomaly):                     │
│ ❱ 1163 │   │   │   self.fit_loop.run()                                                           │
│   1164 │                                                                                │
│   1165 │   def _run_evaluate(self) -> _EVALUATE_OUTPUT:                                          │
│   1166 │   │   assert self.evaluating                                                            │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/fit_loop.py:267 in advance        │
│                                                                                │
│   264 │   │   assert self._data_fetcher is not None                                              │
│   265 │   │   self._data_fetcher.setup(dataloader, batch_to_device=batch_to_device)              │
│   266 │   │   with self.trainer.profiler.profile("run_training_epoch"):                          │
│ ❱ 267 │   │   │   self._outputs = self.epoch_loop.run(self._data_fetcher)                        │
│   268 │                                                                                │
│   269 │   def on_advance_end(self) -> None:                                                      │
│   270 │   │   # inform logger the batch loop has finished                                        │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py:214  │
│ in advance                                                                                │
│                                                                                │
│   211 │   │   │   self.batch_progress.increment_started()                                        │
│   212 │   │   │                                                                                │
│   213 │   │   │   with self.trainer.profiler.profile("run_training_batch"):                      │
│ ❱ 214 │   │   │   │   batch_output = self.batch_loop.run(kwargs)                                 │
│   215 │   │                                                                                │
│   216 │   │   self.batch_progress.increment_processed()                                          │
│   217                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/batch/training_batch_loop.py:88   │
│ in advance                                                                                │
│                                                                                │
│    85 │   │   │   optimizers = _get_active_optimizers(                                           │
│    86 │   │   │   │   self.trainer.optimizers, self.trainer.optimizer_frequencies, kwargs.get(   │
│    87 │   │   │   )                                                                              │
│ ❱  88 │   │   │   outputs = self.optimizer_loop.run(optimizers, kwargs)                          │
│    89 │   │   else:                                                                              │
│    90 │   │   │   outputs = self.manual_loop.run(kwargs)                                         │
│    91 │   │   if outputs:                                                                        │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py:199 in run                │
│                                                                                │
│   196 │   │   while not self.done:                                                               │
│   197 │   │   │   try:                                                                           │
│   198 │   │   │   │   self.on_advance_start(*args, **kwargs)                                     │
│ ❱ 199 │   │   │   │   self.advance(*args, **kwargs)                                              │
│   200 │   │   │   │   self.on_advance_end()                                                      │
│   201 │   │   │   │   self._restarting = False                                                   │
│   202 │   │   │   except StopIteration:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:20 │
│ 0 in advance                                                                                │
│                                                                                │
│   197 │   def advance(self, optimizers: List[Tuple[int, Optimizer]], kwargs: OrderedDict) -> N   │
│   198 │   │   kwargs = self._build_kwargs(kwargs, self.optimizer_idx, self._hiddens)             │
│   199 │   │                                                                                │
│ ❱ 200 │   │   result = self._run_optimization(kwargs, self._optimizers[self.optim_progress.opt   │
│   201 │   │   if result.loss is not None:                                                        │
│   202 │   │   │   # automatic optimization assumes a loss needs to be returned for extras to b   │
│   203 │   │   │   # would be skipped otherwise                                                   │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:24 │
│ 7 in _run_optimization                                                                           │
│                                                                                │
│   244 │   │   # gradient update with accumulated gradients                                       │
│   245 │   │   else:                                                                              │
│   246 │   │   │   # the batch_idx is optional with inter-batch parallelism                     │
│ ❱ 247 │   │   │   self._optimizer_step(optimizer, opt_idx, kwargs.get("batch_idx", 0), closure   │
│   248 │   │                                                                                │
│   249 │   │   result = closure.consume_result()                                                  │
│   250                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:36 │
│ 6 in _optimizer_step                                                                             │
│                                                                                │
│   363 │   │   │   train_step_and_backward_closure,                                               │
│   364 │   │   │   on_tpu=isinstance(self.trainer.accelerator, TPUAccelerator),                   │
│   365 │   │   │   using_native_amp=(self.trainer.amp_backend == AMPType.NATIVE),                 │
│ ❱ 366 │   │   │   using_lbfgs=is_lbfgs,                                                          │
│   367 │   │   )                                                                                │
│   368 │   │                                                                                │
│   369 │   │   if not should_accumulate:                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1305 in              │
│ _call_lightning_module_hook                                                                      │
│                                                                                │
│   1302 │   │   pl_module._current_fx_name = hook_name                                            │
│   1303 │   │                                                                                │
│   1304 │   │   with self.profiler.profile(f"[LightningModule]{pl_module.class.name}.{ho  │
│ ❱ 1305 │   │   │   output = fn(*args, **kwargs)                                                  │
│   1306 │   │                                                                                │
│   1307 │   │   # restore current_fx when nested context                                          │
│   1308 │   │   pl_module._current_fx_name = prev_fx_name                                         │
│                                                                                │
│ /home/tolstoy/SaProt/model/abstract_model.py:135 in optimizer_step                               │
│                                                                                │
│   132 │   │   using_lbfgs: bool = False,                                                         │
│   133 │   ) -> None:                                                                             │
│   134 │   │   super().optimizer_step(                                                            │
│ ❱ 135 │   │   │   epoch, batch_idx, optimizer, optimizer_idx, optimizer_closure, on_tpu, using   │
│   136 │   │   )                                                                                │
│   137 │   │   self.step += 1                                                                     │
│   138                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/core/module.py:1661 in optimizer_step   │
│                                                                                │
│   1658 │   │   │   │   │   │   pg["lr"] = lr_scale * self.learning_rate                          │
│   1659 │   │                                                                                │
│   1660 │   │   """                                                                               │
│ ❱ 1661 │   │   optimizer.step(closure=optimizer_closure)                                         │
│   1662 │                                                                                │
│   1663 │   def optimizer_zero_grad(self, epoch: int, batch_idx: int, optimizer: Optimizer, opti  │
│   1664 │   │   """Override this method to change the default behaviour of ``optimizer.zero_grad  │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/core/optimizer.py:169 in step           │
│                                                                                │
│   166 │   │   │   raise MisconfigurationException("When optimizer.step(closure) is called, t   │
│   167 │   │                                                                                │
│   168 │   │   assert self._strategy is not None                                                  │
│ ❱ 169 │   │   step_output = self._strategy.optimizer_step(self._optimizer, self._optimizer_idx   │
│   170 │   │                                                                                │
│   171 │   │   self._on_after_step()                                                              │
│   172                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/strategies/ddp.py:281 in optimizer_step │
│                                                                                │
│   278 │   │   │   model: reference to the model, optionally defining optimizer step related ho   │
│   279 │   │   │   **kwargs: Any extra arguments to ``optimizer.step``                            │
│   280 │   │   """                                                                                │
│ ❱ 281 │   │   optimizer_output = super().optimizer_step(optimizer, opt_idx, closure, model, **   │
│   282 │   │                                                                                │
│   283 │   │   if not _TORCH_GREATER_EQUAL_1_10 or self._model_averager is None:                  │
│   284 │   │   │   return optimizer_output                                                        │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/strategies/strategy.py:235 in           │
│ optimizer_step                                                                                │
│                                                                                │
│   232 │   │   # TODO(lite): remove assertion once strategy's optimizer_step typing is fixed      │
│   233 │   │   assert isinstance(model, pl.LightningModule)                                       │
│   234 │   │   return self.precision_plugin.optimizer_step(                                       │
│ ❱ 235 │   │   │   optimizer, model=model, optimizer_idx=opt_idx, closure=closure, **kwargs       │
│   236 │   │   )                                                                                │
│   237 │                                                                                │
│   238 │   def _setup_model_and_optimizers(self, model: Module, optimizers: List[Optimizer]) ->   │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/plugins/precision/native_amp.py:85 in   │
│ optimizer_step                                                                                │
│                                                                                │
│    82 │   │   │   raise MisconfigurationException(                                               │
│    83 │   │   │   │   f"Native AMP and the LBFGS optimizer are not compatible (optimizer {opti   │
│    84 │   │   │   )                                                                              │
│ ❱  85 │   │   closure_result = closure()                                                         │
│    86 │   │                                                                                │
│    87 │   │   if not _optimizer_handles_unscaling(optimizer):                                    │
│    88 │   │   │   # Unscaling needs to be performed here in case we are going to apply gradien   │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:14 │
│ 7 in call                                                                                │
│                                                                                │
│   144 │   │   return step_output                                                                 │
│   145 │                                                                                │
│   146 │   def call(self, *args: Any, **kwargs: Any) -> Optional[Tensor]:                     │
│ ❱ 147 │   │   self._result = self.closure(*args, **kwargs)                                       │
│   148 │   │   return self._result.loss                                                           │
│   149                                                                                │
│   150                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:13 │
│ 3 in closure                                                                                │
│                                                                                │
│   130 │   │   self._zero_grad_fn = zero_grad_fn                                                  │
│   131 │                                                                                │
│   132 │   def closure(self, *args: Any, **kwargs: Any) -> ClosureResult:                         │
│ ❱ 133 │   │   step_output = self._step_fn()                                                      │
│   134 │   │                                                                                │
│   135 │   │   if step_output.closure_loss is None:                                               │
│   136 │   │   │   self.warning_cache.warn("training_step returned None. If this was on pur   │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/loops/optimization/optimizer_loop.py:40 │
│ 6 in _training_step                                                                              │
│                                                                                │
│   403 │   │   │   A ``ClosureResult`` containing the training step output.                       │
│   404 │   │   """                                                                                │
│   405 │   │   # manually capture logged metrics                                                  │
│ ❱ 406 │   │   training_step_output = self.trainer._call_strategy_hook("training_step", *kwargs   │
│   407 │   │   self.trainer.strategy.post_training_step()                                         │
│   408 │   │                                                                                │
│   409 │   │   model_output = self.trainer._call_lightning_module_hook("training_step_end", tra   │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py:1443 in              │
│ call_strategy_hook                                                                              │
│                                                                                │
│   1440 │   │   │   return                                                                        │
│   1441 │   │                                                                                │
│   1442 │   │   with self.profiler.profile(f"[Strategy]{self.strategy.class.name}.{hook  │
│ ❱ 1443 │   │   │   output = fn(*args, **kwargs)                                                  │
│   1444 │   │                                                                                │
│   1445 │   │   # restore current_fx when nested context                                          │
│   1446 │   │   pl_module._current_fx_name = prev_fx_name                                         │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/strategies/ddp.py:352 in training_step  │
│                                                                                │
│   349 │   def training_step(self, *args: Any, **kwargs: Any) -> STEP_OUTPUT:                     │
│   350 │   │   assert self.model is not None                                                      │
│   351 │   │   with self.precision_plugin.train_step_context():                                   │
│ ❱ 352 │   │   │   return self.model(*args, **kwargs)                                             │
│   353 │                                                                                │
│   354 │   def validation_step(self, *args: Any, **kwargs: Any) -> Optional[STEP_OUTPUT]:         │
│   355 │   │   with self.precision_plugin.val_step_context():                                     │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py:1194 in _call_impl             │
│                                                                                │
│   1191 │   │   # this function, and just call forward.                                           │
│   1192 │   │   if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o  │
│   1193 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks):                   │
│ ❱ 1194 │   │   │   return forward_call(*input, **kwargs)                                         │
│   1195 │   │   # Do not call functions when jit is used                                          │
│   1196 │   │   full_backward_hooks, non_full_backward_hooks = [], []                             │
│   1197 │   │   if self._backward_hooks or _global_backward_hooks:                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/torch/nn/parallel/distributed.py:1040 in forward          │
│                                                                                │
│   1037 │   │   │   │   # Notify joined ranks whether they should sync in backwards pass or not.  │
│   1038 │   │   │   │   self._check_global_requires_backward_grad_sync(is_joined_rank=False)      │
│   1039 │   │   │                                                                                │
│ ❱ 1040 │   │   │   output = self._run_ddp_forward(*inputs, **kwargs)                             │
│   1041 │   │   │                                                                                │
│   1042 │   │   │   # sync params according to location (before/after forward) user               │
│   1043 │   │   │   # specified as part of hook, if hook was specified.                           │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/torch/nn/parallel/distributed.py:1000 in _run_ddp_forward │
│                                                                                │
│    997 │   │   │   │   self.use_side_stream_for_tensor_copies                                    │
│    998 │   │   │   )                                                                             │
│    999 │   │   │   with self._inside_ddp_forward():                                              │
│ ❱ 1000 │   │   │   │   return module_to_run(*inputs[0], **kwargs[0])                             │
│   1001 │   │   else:                                                                             │
│   1002 │   │   │   with self._inside_ddp_forward():                                              │
│   1003 │   │   │   │   return module_to_run(*inputs, **kwargs)                                   │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py:1194 in _call_impl             │
│                                                                                │
│   1191 │   │   # this function, and just call forward.                                           │
│   1192 │   │   if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o  │
│   1193 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks):                   │
│ ❱ 1194 │   │   │   return forward_call(*input, **kwargs)                                         │
│   1195 │   │   # Do not call functions when jit is used                                          │
│   1196 │   │   full_backward_hooks, non_full_backward_hooks = [], []                             │
│   1197 │   │   if self._backward_hooks or _global_backward_hooks:                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/pytorch_lightning/overrides/base.py:98 in forward         │
│                                                                                │
│    95 │   │                                                                                │
│    96 │   │   if trainer is not None:                                                            │
│    97 │   │   │   if trainer.training:                                                           │
│ ❱  98 │   │   │   │   output = self._forward_module.training_step(*inputs, **kwargs)             │
│    99 │   │   │   │   # In manual_optimization, we need to prevent DDP reducer as                │
│   100 │   │   │   │   # it is done manually in LightningModule.manual_backward                 │
│   101 │   │   │   │   # require_backward_grad_sync will be reset in the                        │
│                                                                                │
│ /home/tolstoy/SaProt/model/abstract_model.py:145 in training_step                                │
│                                                                                │
│   142 │   def training_step(self, batch, batch_idx):                                             │
│   143 │   │   inputs, labels = batch                                                             │
│   144 │   │   outputs = self(**inputs)                                                           │
│ ❱ 145 │   │   loss = self.loss_func('train', outputs, labels)                                    │
│   146 │   │   return loss                                                                        │
│   147 │                                                                                │
│   148 │   def validation_step(self, batch, batch_idx):                                           │
│                                                                                │
│ /home/tolstoy/SaProt/model/esm/esm_regression_model.py:55 in loss_func                           │
│                                                                                │
│   52 │   │   │   metric.update(outputs.detach().float(), fitness.float())                        │
│   53 │   │                                                                                │
│   54 │   │   if stage == "train":                                                                │
│ ❱ 55 │   │   │   log_dict = self.get_log_dict("train")                                           │
│   56 │   │   │   self.log_info(log_dict)                                                         │
│   57 │   │   │                                                                                │
│   58 │   │   │   # Reset train metrics                                                           │
│                                                                                │
│ /home/tolstoy/SaProt/model/abstract_model.py:242 in get_log_dict                                 │
│                                                                                │
│   239 │   │   │   A dictionary of metrics for the stage. Keys are metric names and values are    │
│   240 │   │                                                                                │
│   241 │   │   """                                                                                │
│ ❱ 242 │   │   return {name: metric.compute() for name, metric in self.metrics[stage].items()}    │
│   243 │                                                                                │
│   244 │   def log_info(self, info: dict) -> None:                                                │
│   245 │   │   """                                                                                │
│                                                                                │
│ /home/tolstoy/SaProt/model/abstract_model.py:242 in                                    │
│                                                                                │
│   239 │   │   │   A dictionary of metrics for the stage. Keys are metric names and values are    │
│   240 │   │                                                                                │
│   241 │   │   """                                                                                │
│ ❱ 242 │   │   return {name: metric.compute() for name, metric in self.metrics[stage].items()}    │
│   243 │                                                                                │
│   244 │   def log_info(self, info: dict) -> None:                                                │
│   245 │   │   """                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/torchmetrics/metric.py:531 in wrapped_func                │
│                                                                                │
│   528 │   │   │   │   should_sync=self._to_sync,                                                 │
│   529 │   │   │   │   should_unsync=self._should_unsync,                                         │
│   530 │   │   │   ):                                                                             │
│ ❱ 531 │   │   │   │   value = compute(*args, **kwargs)                                           │
│   532 │   │   │   │   self._computed = _squeeze_if_scalar(value)                                 │
│   533 │   │   │                                                                                │
│   534 │   │   │   return self._computed                                                          │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/torchmetrics/regression/r2.py:127 in compute              │
│                                                                                │
│   124 │   def compute(self) -> Tensor:                                                           │
│   125 │   │   """Computes r2 score over the metric states."""                                    │
│   126 │   │   return _r2_score_compute(                                                          │
│ ❱ 127 │   │   │   self.sum_squared_error, self.sum_error, self.residual, self.total, self.adju   │
│   128 │   │   )                                                                                │
│   129                                                                                │
│                                                                                │
│ /opt/conda/lib/python3.7/site-packages/torchmetrics/functional/regression/r2.py:79 in            │
│ _r2_score_compute                                                                                │
│                                                                                │
│    76 │   │   tensor([0.9654, 0.9082])                                                           │
│    77 │   """                                                                                │
│    78 │   if n_obs < 2:                                                                          │
│ ❱  79 │   │   raise ValueError("Needs at least two samples to calculate r2 score.")              │
│    80 │                                                                                │
│    81 │   mean_obs = sum_obs / n_obs                                                             │
│    82 │   tss = sum_squared_obs - sum_obs * mean_obs                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Needs at least two samples to calculate r2 score.
Epoch 0:  90%|████████▉ | 2845/3166 [05:58<00:40,  7.94it/s, loss=0.0267]

The error is caused when you calculate the metric with only 1 sample in a batch. I already fixed it by skip calculating when a batch contains only 1 sample.

authors: LTEnjoy igortru

repo: westlake-repl/SaProt


text:
MIDI Track Basic Arpeggiator

A basic tempo-synced arpeggiator option would be really nice for the MIDI>CV track mode.

This was in the back of my head for a while. It will probably get in at some point in the future.

Great! Looking forward to it.

I said “basic”, but obviously, things like play direction and real-time randomisation would be cool, too ;)
I will wait to see what you come up with, anyway.

I said “basic”, but obviously, things like play direction and real-time randomisation would be cool, too ;)

hehe

Have you dropped this idea entirely, or is it incorporated into a branch you're working on?

It's about to be released.

source: gharchive/issue

authors: toneburst westlicht

repo: westlicht/performer

license: MIT

license_type: permissive

license_source: github-api


text:
Deployless calls are disabled

Check existing issues

[X] I checked there isn't already an issue for the bug I encountered.

Describe the bug
The following piece of code:
useReadContract({
  abi: parseAbi(['function name() view returns (string)']),
  code: '0x...', // Accessible here: https://etherscan.io/address/0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2#code
  functionName: 'name',
})

does not trigger any call because the query is disabled at this line because no address is provided. What is the reason for this?
Link to Minimal Reproducible Example
https://stackblitz.com/edit/new-wagmi-d5fk5x?file=src%2FApp.tsx
Steps To Reproduce
No response
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
2.12.9
Viem Version
2.21.4
TypeScript Version
5.4.5
Anything else?
No response

Also note there's no test case for deployless reads

repo: wevm/wagmi


text:
Passing "resolveInternal" option causes "RangeError" when resolving a spec

Detailed description
This might be a bug with oas-resolver but the front-door we are using to resolve the OpenApi specs is speccy.
Resolving refs works fine with the following options
const SPECCY_OPTIONS = {
  resolve: true,
  jsonSchema: true,
}

The above options cause the first external ref to be resolved, but subsequent external refs to that same file get converted to internal refs.
We have a use case where we need all the refs to be resolved and not have any internal refs, so I used the following options
const SPECCY_OPTIONS = {
  resolve: true,
  jsonSchema: true,
  resolveInternal: true,
}

This causes the following error -
RangeError: Maximum call stack size exceeded
at String.replace (<anonymous>)
at jpescape (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/jptr.js:9:14)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:34:60)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)
at recurse (/Users/mkothari/git/platform-specs/node_modules/reftools/lib/recurse.js:53:13)

Node Version: 12.18.0
Operating system and version (e.g. Ubuntu 16.04, Windows 7): Mac 10.15.5
Speccy Version: 0.11.0

An additional note - this the schema does have recursion and is structured as given in the example from the json-schema docs - https://json-schema.org/understanding-json-schema/structuring.html#recursion

A quick example test case -
the yaml spec, say temp.yaml -
openapi: 3.0.2
info:
  title: api
  description: |
    description!
  contact:
    name: 'team'
    url: 'https://test.com/'
    email: 'test@test.com'
  version: 0.0.1
servers:
  - url: https://test.com
paths: {}
components:
  responses:
    Request:
      description: request
      content:
        application/json:
          schema:
            $ref: temp.json#/definitions/person
tags: []

the schema in a file temp.json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "person": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "children": {
          "type": "array",
          "items": { "$ref": "#/definitions/person" },
          "default": []
        }
      }
    }
  },
  "type": "object",
  "properties": {
    "person": { "$ref": "#/definitions/person" }
  }
}

The command to run is - speccy resolve ./temp.yaml -j -v -i
Error -
GET ./packages/common-spec/src/specifications/components/temp.yaml
GET /Users/mkothari/git/common-specs/packages/common-spec/src/specifications/components/temp.json #/definitions/person
RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous>)
    at jpescape (/Users/mkothari/git/common-specs/node_modules/reftools/lib/jptr.js:9:14)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:34:60)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:53:13)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:53:13)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:53:13)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:53:13)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:53:13)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:53:13)
    at recurse (/Users/mkothari/git/common-specs/node_modules/reftools/lib/recurse.js:53:13)
Maximum call stack size exceeded

What is your expected (non infinite) output if all internal references are to be replaced?

That's a good question. IMO resolving it to the top level would suffice with a reference back to the object itself further down the tree.
This would be the desired output -
openapi: 3.0.2
info:
  title: api
  description: |
    description!
  contact:
    name: team
    url: https://test.com/
    email: test@test.com
  version: 0.0.1
servers:
  - url: https://test.com
paths: {}
components:
  responses:
    Request:
      description: request
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
              children:
                type: array
                items:
                  $ref: "#/components/responses/Request/content/application~1json/schema"
                default: []
tags: []

That is exactly the output if you don't specifiy resolveInternal: true.

I think I simplified my test yaml too much without showcasing the actual use case I am looking to solve.
If you refer to the same schema multiple times in the spec (which is what we are doing), as shown in the example below -
openapi: 3.0.2
info:
  title: api
  description: |
    description!
  contact:
    name: 'team'
    url: 'https://test.com/'
    email: 'test@test.com'
  version: 0.0.1
servers:
  - url: https://test.com
paths: {}
components:
  responses:
    Request:
      description: request
      content:
        application/json:
          schema:
            $ref: temp.json#/definitions/person
    Request2:
      description: request
      content:
        application/json:
          schema:
            $ref: temp.json#/definitions/person
tags: []

if I don't specify resolveInternal: true then it results in this -
openapi: 3.0.2
info:
  title: api
  description: |
    description!
  contact:
    name: team
    url: https://test.com/
    email: test@test.com
  version: 0.0.1
servers:
  - url: https://test.com
paths: {}
components:
  responses:
    Request:
      description: request
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
              children:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    children:
                      type: array
                      items:
                        $ref: "#/components/responses/Request/content/application~1json/schema/properti\
                          es/children/items"
                      default: []
                default: []
    Request2:
      description: request
      content:
        application/json:
          schema:
            $ref: "#/components/responses/Request/content/application~1json/schema"
tags: []

It resolves it the first time, and then any future references point to the first place it was resolved.
Our goal was to have it resolve in all spots, which is why we added  resovleInternal: true, which then resulted in the RangeError.

repo: wework/speccy


text:
IPv6 Support

Are there any plans to Support IPv6 tunneling?

Hi.
It's not something I'm currently looking at, but I'm happy to accept pull requests if it's something you'd consider working on.

Okay, I was already considering implementing it. However, I cannot make a promise to when I'll have the time to do so.

repo: wheelybird/openvpn-server-ldap-otp

license: mit

license_source: bigquery


text:
Sheet wont show/open

Describe the bug
For some reason when i try to create a merchant I can't open that actor. Seems like its trying to access game.users.players. But the player object is empty.
in the prepareGMSettings function
row 351: const actor = g.actors.get(player.character.id);
To Reproduce
Just create a actor NPC and change sheet to Merchant NPC
I can then reproduce the bug by clicking the NPC in the Actor list.
Expected behavior
To see the sheet
Screenshots

Desktop (please complete the following information):

Browser [e.g. chrome, safari]
Chrome

Any progress on this? It is certain that it does NOT work, at least not on actors who are not linked to a specific actor.

I agree, it still does not work.

repo: whelan/fvtt-merchant-sheet-npc


text:
Tag view height

Tag View auto height is not working properly.

@usmantararnxb Which version are you using?

@ricardopereira I am also facing a issue with tag height. In my case my tag text content is very big almost 2 lines. In this case it display in a single line tag and rest of the text is truncated with period. (The rest.......) So if is there any way to make the tag multiline as per the text content please help me.

@ravikanhasoft With the latest version?

@ricardopereira  Yes with a latest version.  You can see from this Screen shot.

Oh, now I see what you mean. Thanks for your screenshot. This library isn't ready to word-wrap a tag. Sorry. Even so, I'll open an issue for that and let's see if anyone from the community wants to implement that.

repo: whitesmith/WSTagsField


text:
图片标题caption内添加引用cite时报错

加了\protect还是报错，将cite放在caption{}外面不报错了，但是编译后引用上标与标题不在同一行了

给代码，下次再这样提问直接删除。

\caption{CBAM子模块示意图\cite{woo2018cbam}}
\caption{CBAM子模块示意图 \protect\cite{woo2018cbam}}
均报错

Extra }, or forgotten \endgroup.
 ...AM子模块示意图 \cite {woo2018cbam}\relax }

顺便一提，github 里提issue提供了提问模版。

repo: whutug/whu-thesis


text:
🛑 Terany 🇬🇧 (en) is down

In ccb2dfa, Terany 🇬🇧 (en) (https://holiday-lescala.com/en/h/house-terany/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Terany 🇬🇧 (en) is back up in 6b617e4 after 17 minutes.

repo: whytspace/upptime-holiday-lescala


text:
Thoughts on building esm at python packaging time

What are your thoughts on a pattern like this?
In the future, when I care about bundle sizes of my widget, I would prefer not to ship sucrase in the bundled JS.  My _esm cproperties are very small, essentially shims between my component library and ipyreact.  What would it look like if there was no sucrase shipped with js bundle.  (I'm not worried about the time it takes to execute sucrase, this should be minimal.
What if the _esm blocks were hashed and compiled in a step.  Then there was a shipped dictionary from _esm_hash to compiled js.  The frontend code references this dictionary in production mode, and the 1mb sucrase dependency doesn't ship.
This is a pretty advanced optimization that I don't think I'll get to for a while, if ever.  but curious on your thoughts

As I think about it, I'm trying to figure out if I will need to fork ipyreact to suit my needs.  I'd prefer not to.  I'm just thinking about plans for my roadmap.
Here are the things I'd like to do which would require js changes to ipyreact

Easier CSS importing.  Nice to have.  I figured a widget side workaround.  related to this bug
Importing custom css #39
Passing custom messages back and forth to the kernel.  Is custom message passing possible? #70
This bug. building esm at python packaging time #71 - the least important of the core changes I'd like

repo: widgetti/ipyreact


text:
refactor: change balance attribute to is_balanaced method

Instead of a full refactor, I decided to remove the balance attribute from ChemicalEquation and convert the _check_balance method to the is_balanced() -> bool method.
Closes wigging/chemics#29

Please merge this into wigging:dev instead of wigging:main.

Sorry, I have now requested to merge into wigging:dev

In the README you use _is_balanced() but it should be is_balanced().

source: gharchive/pull-request

authors: sheodun wigging

repo: wigging/chemics


text:
Defaulting to using deployed library instead of redeploying even if code is updated?

Describe the bug
Saddle finance's recent exploit report said that hardhat-deploy defaults to using deployed libraries instead of redeploying new ones if code is updated.

The reason the old libraries persisted was because deployments are controlled by the “hardhat-deploy” plugin. This plugin has the behavior of defaulting to using previously-deployed instances of libraries, instead of redeploying new libraries if code is updated.

Can anyone help clarify this? Is this a possible bug or an operational error on Saddle's side?
What's the best practice if we are deploying a fixed library?
Expected behavior
If library is updated, hardhat-deploy should deploy the new library instead of reusing an existing one.
Additional context
Saddle Finance exploit report: https://blog.saddle.finance/4-30-2022-post-mortem-of-mainnet-susdv2-metapool-exploit/

hmm, that's not true
hardhat-deploy do not even try to deploy libraries, this has to be done by the user
and if it use the default option when deploying the library it will redeploy on code changes

repo: wighawag/hardhat-deploy


text:
Default use owner function to get address

Description
Confidential EVMs such as Sapphire prevents direct getStorageAt calls from accessing raw slot data in order to allow a smart contract to permission access to its own state.
The default proxy supports the EIP173 spec function owner which appears to be the smoothest path towards supporting additional EVM like networks.
Would y'all find this compatible? An alternative solution would be to compare msg.data with a set of predefined keys and to return the storage slot.
https://github.com/wighawag/hardhat-deploy/blob/e3727896a812fe1a17e04f52a4aecc42c7b13ed4/solc_0.8/proxy/EIP173Proxy.sol#L29-L31
Relates to issue https://github.com/wighawag/hardhat-deploy/issues/530.

Happy to have that in, but it should support both.
it should check if the proxy has an owner function and uses it if it does, else fallback on reading storage slot

Happy to have that in, but it should support both. it should check if the proxy has an owner function and uses it if it does, else fallback on reading storage slot

Appreciate the feedback. Will do.

@wighawag one more look please?

Thanks!
available in 0.12.3

authors: aefhm wighawag


text:
valid-package-file-require false positive when filename conflicts with package name

If I have
require( 'ext.MyModule' );

and ext.MyModule.js exists, then the rule marks this as an error, even though this is a perfectly valid name for a package that includes that file.
Rather than doing a complex file check, it might just be better to look for an allowed extension ("js","json", others?)
CC @jakobw @Ladsgroup

Sorry for the late response. I quite like the solution in #21. Only looking for an extension wouldn't have been sufficient since erroring when omitting the extension in a path like ./foo was exactly the point of this rule. Checking for either the extension or the directory prefix to exist makes sense though!

repo: wikimedia/eslint-plugin-mediawiki


text:
Stickyfill's module dist redefine's the window object, always commits 'seppuku'

I'm having a lot of trouble getting this polyfill to work.  I can see that it's installed, and I can add elements to stickyfill, but it doesn't seem to do anything. I've tried your test page and verified it working in IE11, so I'm wondering if there's some sort of collision with another library going on.
Below is a screenshot of my console in Browserstack.  You can see both elements are there and both are _stickyMode = null.  One is a H1 element whose only parent is the <body>. The other is a nav element that is position: sticky and works in Chrome without Stickyfill.

I'm pulling in the library asynchronously like so:
if (!Modernizr.csspositionsticky) {
    promises.push(
      // tslint:disable-next-line
      import(/* webpackChunkName: "sticky-polyfill" */ 'stickyfilljs')
        .then((stickyfill) => {
          window['Stickyfill'] = stickyfill;
        }),
    );
  }

And using it like so:
// Apply Position Sticky polyfill
if (!Modernizr.csspositionsticky) {
  window['Stickyfill'].add(document.querySelectorAll('.section__tabs'));
}

Any ideas for troubleshooting?

Hi, I need to see your page to help you.

whoops, didn’t mean to close

I've figured out the issue... sorta.  It's committing Seppuku in my IE11, so there's definitely a collision.
I'll try to get a test page up here shortly, but I suspect it might be Modernizr.

window.getComputedStyle is returning undefined when the Module is run.  In my IE11's console, it's working as expected.

The problem is this line here.  When used as a module, this is not the window object, so you end up redefining window for the rest of the script.

As others have mentioned in #54 and #43, I'd leave feature detection off. It'd be better to assume the browser's broken and leave feature detection up to a library like Modernizr.

Oh, I see. I’ve tested a bunch of bundlers and they didn’t mess with this, so it slipped past me.
I use these args for better minification, actually. They become a and b in minified version. It’s not much, but I’ll accept your PR and leave them be.
As for the feature detection, I won’t remove it completely, but I’m planning to add an option to disable it.
Thanks!

Sounds good, thanks!

authors: soluml wilddeer

repo: wilddeer/stickyfill


text:
Explain usage of CamelContextFactory

Some tests use
    @ArquillianResource
    CamelContextFactory contextFactory;
    ...
    WildFlyCamelContext camelctx = contextFactory.createCamelContext();

others use
        CamelContext camelctx = new DefaultCamelContext();

document the difference and when it is necessary to use the WildFlyCamelContext

Done
https://github.com/wildfly-extras/wildfly-camel-book/blob/2.2/javaee/jndi.md

repo: wildfly-extras/wildfly-camel


text:
[WFCORE-1805]:  Re-enabming the test and trying to get an error cause.

Jira: https://issues.jboss.org/browse/WFCORE-1805

Windows Build 3853 outcome was FAILURE using a merge of 195251d3148ddf83959eead9e2f94e923d9b945d
Summary: Execution timeout (new); tests passed: 3877, ignored: 58 Build time: 01:15:10

retest this please

authors: ehsavoie wildfly-ci

repo: wildfly/wildfly-core


text:
[WFCORE-3762] Actually create the response warning; the previous fix …

…would never actually do that.
Make the level WARNING not INFO as by default INFO is not sent to the user, making this pointless.
Also, avoid repeated response warnings from different steps for the same end user op.
Second shot at https://issues.jboss.org/browse/WFCORE-3762

Core - Full Integration Build 7306 outcome was UNKNOWN using a merge of 10f481b407bf46f1f1a7772b028c19d9b2617493
Summary: Canceled (Tests passed: 683, ignored: 42; exit code 137 (new)) Build time: 00:04:19

authors: bstansberry wildfly-ci