DECODE icon indicating copy to clipboard operation
DECODE copied to clipboard

RuntimeError during training simulation with example data (DECODE v0.10.2)

Open liuyuan9226 opened this issue 2 months ago • 0 comments

Dear DECODE developers,

First and foremost, thank you so much for your incredible work on DECODE! It's a very impressive and well-structured tool, and I truly appreciate the effort you've put into documenting and providing examples.

I'm currently testing DECODE v0.10.2 in a local installation, following the provided documentation exactly. I've made no parameter changes and am using the example data. However, when running the Training.ipynb notebook, I encounter a RuntimeError at the following step:

tar_em, sim_frames, bg_frames = simulator.sample()
sim_frames = sim_frames.cpu()

Error Details:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[12], line 1
----> 1 tar_em, sim_frames, bg_frames = simulator.sample()
      2 sim_frames = sim_frames.cpu()
      4 frame_path = zip_folder / 'frames.tif'  # change if you load your own data

File D:\Software\anaconda3\envs\decode_env_2\lib\site-packages\decode\simulation\simulator.py:56, in Simulation.sample(self)
     46 """
     47 Sample a new set of emitters and forward them through the simulation pipeline.
     48 
   (...)
     52     torch.Tensor: background frames
     53 """
     55 emitter = self.em_sampler()
---> 56 frames, bg = self.forward(emitter)
     57 return emitter, frames, bg

File D:\Software\anaconda3\envs\decode_env_2\lib\site-packages\decode\simulation\simulator.py:81, in Simulation.forward(self, em, ix_low, ix_high)
     78 if ix_high is None:
     79     ix_high = self.frame_range[1]
---> 81 frames = self.psf.forward(em.xyz_px, em.phot, em.frame_ix,
     82                           ix_low=ix_low, ix_high=ix_high)
     84 """
     85 Add background. This needs to happen here and not on a single frame, since background may be correlated.
     86 The difference between background and noise is, that background is assumed to be independent of the 
     87 emitter position / signal.
     88 """
     89 if self.background is not None:

File D:\Software\anaconda3\envs\decode_env_2\lib\site-packages\decode\simulation\psf_kernel.py:771, in CubicSplinePSF.forward(self, xyz, weight, frame_ix, ix_low, ix_high)
    767 xyz_r = self.coord2impl(xyz_r)
    769 n_frames = ix_high - ix_low + 1
--> 771 frames = self._spline_impl.forward_frames(*self.img_shape,
    772                                           frame_ix,
    773                                           n_frames,
    774                                           xyz_r[:, 0],
    775                                           xyz_r[:, 1],
    776                                           xyz_r[:, 2],
    777                                           ix[:, 0],
    778                                           ix[:, 1],
    779                                           weight)
    781 frames = torch.from_numpy(frames).reshape(n_frames, *self.img_shape)
    782 return frames

RuntimeError: Error during ROI computation computation.
Code: 77
Information: 
an illegal memory access was encountered

Environment:

  • DECODE version: 0.10.2
  • Installation: Local, following the official documentation
  • Data: Example data (unchanged)
  • Parameters: Default (unchanged)
  • Operating System: Windows
  • Python Environment: Anaconda

Additional Context:

This error occurs consistently when calling simulator.sample(). I've double-checked the installation and environment setup, and everything seems correct according to the documentation.

Has anyone else reported a similar issue, or could you provide any insight into what might be causing this "illegal memory access" error during ROI computation?

Thank you again for your time and support. I'm looking forward to your response!

Best regards, Yuan

liuyuan9226 avatar Nov 11 '25 16:11 liuyuan9226