FourierEncoder not flexible enough for different detectors
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
調査の方向性
Start with src/graphnet/models/components/embedding.py, especially FourierEncoder.forward, where the traceback shows the auxiliary feature read from index 5; then check how src/graphnet/models/gnn/icemix.py passes features into the encoder. Reproduce with examples/04_training/06_train_icemix_model.py and data with extra fields. Done when the encoder handles the documented detector layout without an index error.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The FourierEncoder module assumes that the input data is in the format of (x, y, z, time, charge, auxiliary). However, e.g. for the IceCube86 detector, data comes in the format (x, y, z, time, charge, ..., auxiliary). This runs into an index error because the module has the slicing of the data hard coded.
To Reproduce
Run the examples/04_training/06_train_icemix_model.py script on any kind of data that uses a different structure than the assumed (e.g. IceCube86).
Expected behavior
The module should work for any data structure.
Full traceback
Traceback (most recent call last):
File "/ptmp/mpp/mbranden/graphnet/playground/icemix_pretrain.py", line 225, in <module>
main(
File "/ptmp/mpp/mbranden/graphnet/playground/icemix_pretrain.py", line 176, in main
model.fit(
File "/ptmp/mpp/mbranden/graphnet/src/graphnet/models/easy_model.py", line 169, in fit
trainer.fit(
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 538, in fit
call._call_and_handle_interrupt(
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/trainer/call.py", line 46, in _call_and_handle_interrupt
return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 105, in launch
return function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 574, in _fit_impl
self._run(model, ckpt_path=ckpt_path)
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 981, in _run
results = self._run_stage()
^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 1023, in _run_stage
self._run_sanity_check()
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/trainer/trainer.py", line 1052, in _run_sanity_check
val_loop.run()
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/loops/utilities.py", line 178, in _decorator
return loop_run(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 135, in run
self._evaluation_step(batch, batch_idx, dataloader_idx, dataloader_iter)
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/loops/evaluation_loop.py", line 396, in _evaluation_step
output = call._call_strategy_hook(trainer, hook_name, *step_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/trainer/call.py", line 319, in _call_strategy_hook
output = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/strategies/strategy.py", line 410, in validation_step
return self._forward_redirection(self.model, self.lightning_module, "validation_step", *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/strategies/strategy.py", line 640, in __call__
wrapper_output = wrapper_module(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1523, in forward
else self._run_ddp_forward(*inputs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/parallel/distributed.py", line 1359, in _run_ddp_forward
return self.module(*inputs, **kwargs) # type: ignore[index]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/pytorch_lightning/strategies/strategy.py", line 633, in wrapped_forward
out = method(*_args, **_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/graphnet/src/graphnet/models/easy_model.py", line 264, in validation_step
loss = self.shared_step(val_batch, batch_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/graphnet/src/graphnet/models/standard_model.py", line 117, in shared_step
preds = self(batch)
^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/graphnet/src/graphnet/models/standard_model.py", line 104, in forward
x = self.backbone(d)
^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/graphnet/src/graphnet/models/gnn/icemix.py", line 132, in forward
x = self.fourier_ext(x0, seq_length)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/graphnet/src/graphnet/models/components/embedding.py", line 129, in forward
embeddings.append(self.aux_emb(x[:, :, 5].long())) # Auxiliary
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/modules/sparse.py", line 163, in forward
return F.embedding(
^^^^^^^^^^^^
File "/ptmp/mpp/mbranden/.conda/envs/graphnet2/lib/python3.11/site-packages/torch/nn/functional.py", line 2237, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: index out of range in self
- 主要言語
- Python
- スター
- 117
- フォーク
- 115
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphnet-team/graphnet のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
graphnet-team/graphnet#933 ·
-
Spring cleanオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
graphnet-team/graphnet#927 · コメント 1 件 ·
-
Time for a new version release v1.8.1再び着手できるかも @Aske-Rosted が 75 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンdecision
graphnet-team/graphnet#924 · 担当者 1 名 ·
-
Make kaggle checkpoints part of the CI再び着手できるかも @sevmag が 75 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
graphnet-team/graphnet#921 · コメント 2 件 · 担当者 1 名 ·
-
decision deferred
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
graphnet-team/graphnet#919 ·
graphnet-team/graphnet の issue をすべて見る
似ている issue
-
MarkdownDocSerializer.post_process escapes '\<' to '\<', rendering literal '<' in CommonMarkオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
docling-project/docling-core#1067 ·
メンテナーはふだん 3 日以内に返信
-
correction metadata
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
acl-org/acl-anthology#11101 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] crewai tool create/install/login exit 0 when they fail対応中かも @Kiko0301 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
vllm-project/compressed-tensors#1033 ·
メンテナーはふだん 3 日以内に返信
-
chore kaizen ui-rewrite
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
IBM/mcp-context-forge#7681 ·
メンテナーはふだん 2 日以内に返信