srwi / PyCharm-PixelLens

Free PyCharm image viewer plugin for visualizing and debugging NumPy, OpenCV, PyTorch, TensorFlow, JAX, and PIL data.
https://plugins.jetbrains.com/plugin/25039-pixellens
GNU General Public License v3.0
21 stars 0 forks source link

Tensor can't be viewed in a list, like: List[torch.Tensor] #24

Closed QLYYLQ closed 2 months ago

QLYYLQ commented 2 months ago

image

can't use view as image

there are the setting and error traceback created by pycharm

An exception occurred in the plugin.

Environment:

Exception details:

Error evaluating expression Traceback (most recent call last):
  File "F:\files\PyCharm Professional\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 1565, in do_it
    result = pydevd_vars.evaluate_expression(self.thread_id, self.frame_id, self.expression, self.doExec)
  File "F:\files\PyCharm Professional\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_vars.py", line 461, in evaluate_expression
    return eval_func(expression, updated_globals, frame, doExec, get_eval_exception_msg)
  File "F:\files\PyCharm Professional\plugins\python\helpers-pro\pydevd_asyncio\pydevd_asyncio_utils.py", line 93, in _eval_async_expression
    result = exec_async_code(compiled, global_names)
  File "F:\files\PyCharm Professional\plugins\python\helpers-pro\pydevd_asyncio\pydevd_asyncio_utils.py", line 117, in _exec_async_code
    result = func()
  File "<string>", line 17, in <module>
  File "<string>", line 6, in __srwi_pixellens_image_provider
AttributeError: 'int' object has no attribute 'detach'
com.jetbrains.python.debugger.pydev.AbstractCommand.processResponse(AbstractCommand.java:235)
com.jetbrains.python.debugger.pydev.EvaluateCommand.processResponse(EvaluateCommand.java:43)
com.jetbrains.python.debugger.pydev.AbstractCommand.execute(AbstractCommand.java:166)
com.jetbrains.python.debugger.pydev.RemoteDebugger.executeCommand(RemoteDebugger.java:791)
com.jetbrains.python.debugger.pydev.RemoteDebugger.evaluate(RemoteDebugger.java:158)
com.jetbrains.python.debugger.pydev.MultiProcessDebugger.evaluate(MultiProcessDebugger.java:200)
com.jetbrains.python.debugger.PyDebugProcess.evaluate(PyDebugProcess.java:807)
com.jetbrains.python.debugger.PyDebugProcess.evaluate(PyDebugProcess.java:803)
com.github.srwi.pixellens.interop.Python.executeStatement(Python.kt:21)
com.github.srwi.pixellens.imageProviders.ImageProvider.prepareData(ImageProvider.kt:49)
com.github.srwi.pixellens.imageProviders.ImageProvider.getBatchData(ImageProvider.kt:37)
com.github.srwi.pixellens.imageProviders.ImageProvider.getBatchByExpression(ImageProvider.kt:31)
com.github.srwi.pixellens.actions.ViewAsImageAction$actionPerformed$1.run(ViewAsImageAction.kt:28)
com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477)
com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:250)
com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:100)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:46)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:100)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:250)
com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:500)
com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:81)
com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:86)
com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:81)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
java.base/java.lang.Thread.run(Thread.java:840)
srwi commented 2 months ago

Hi @QLYYLQ, the bug has been fixed in 2aae1e7. I released the 0.2.4 version already on GitHub (you can download it manually if you're in a hurry) but it usually takes JetBrains 1-2 days to approve an update so that PyCharm updates it automatically for you.