简体   繁体   English

在 macOS 上使用 scalene profiler 成功分析 python 脚本的解决方法? 忘记它并使用带有 Windows 或 Linux 的机器吗?

[英]Workaround to successfully profile python script using scalene profiler on macOS? Just forget it and use machine with Windows or Linux?

Computational Science SE question How amenable is this 2D Frenkel–Kontorova-like energy minimization problem in Python to the use of a modest PC + GPU?计算科学 SE 问题Python 中的这个 2D Frenkel–Kontorova 式能量最小化问题对于使用适度的 PC + GPU 来说有多适用? (Heavy reliance on indexing) contains a short example script and note 3 links to my first attempt at profiling using scalene (严重依赖索引)包含一个简短的示例脚本和注释 3链接到我第一次尝试使用scalene进行分析

The results were uninformative, so I followed a recommendation that I try the --profile-all option.结果没有提供任何信息,因此我遵循尝试使用--profile-all选项的建议。 After running for 30 minutes without finishing on a script that took seconds to run I added a CPU percent limit;在运行了 30 分钟但没有完成需要几秒钟运行的脚本后,我添加了 CPU 百分比限制; what I assume means only things that used at least 2% of the CPU time would be profiled in depth.我假设的意思是只有使用至少 2% 的 CPU 时间的东西才会被深入分析。

scalene --html --outfile prof.html  --profile-all --cpu-percent-threshold 2 myscript.py

I received a two line error and was exited from python in a normal way.我收到两行错误,并以正常方式从 python 退出。

Error getting real path: 2
Scalene error: received signal SIGABRT

This issue was closed in scalene issue #110 and there are links there to此问题已在 scalene issue #110中关闭,并且那里有指向

Q: How do I use Scalene with PyTorch?问:如何将 Scalene 与 PyTorch 一起使用?

A: Scalene works with PyTorch version 1.5.1.答: Scalene 适用于 PyTorch 版本 1.5.1。 There's a bug in newer versions of PyTorch ( https://github.com/pytorch/pytorch/issues/57185 ) that interferes with Scalene (discussion here: https://github.com/plasma-umass/scalene/issues/110 ). There's a bug in newer versions of PyTorch ( https://github.com/pytorch/pytorch/issues/57185 ) that interferes with Scalene (discussion here: https://github.com/plasma-umass/scalene/issues/110 )。

there's more information there as well那里还有更多信息

and

Question: Is there a workaround to successfully profile python script using scalene profiler on macOS?问题:是否有解决方法可以在 macOS 上使用 scalene 分析器成功分析 python 脚本? Or should I just move to a machine with Windows or Linux and forget about trying for now?还是我应该转移到一台带有 Windows 或 Linux 的机器上,暂时忘记尝试?

The message, Error getting real path: 2 , seems to have to do with scalene finding your script or a path internal to your script possibly.消息Error getting real path: 2似乎与 scalene 查找脚本或脚本内部路径有关。 Ensure you're referencing a full, valid path for myscript.py , taking into account which directory you're at in the terminal.确保您引用了myscript.py的完整有效路径,同时考虑到您在终端中的哪个目录。 You may need to change directory.您可能需要更改目录。

The SIGABRT message is different from the SIGSEGV issue listed, though, if you wanted to test it, you could uninstall PyTorch ( pip uninstall torch ) and reinstall a specific version ( pip install 'torch==1.5.1' ). The SIGABRT message is different from the SIGSEGV issue listed, though, if you wanted to test it, you could uninstall PyTorch ( pip uninstall torch ) and reinstall a specific version ( pip install 'torch==1.5.1' ).

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行模块解决方法python“Scalene” - Running a module workaround python "Scalene" 在Linux或Windows计算机上为Mac编写python脚本 - Writing python script for a Mac on a linux or windows machine 如何在Windows中使用IDLE在python中使用Memory Profiler - how to use memory profiler in python in windows using IDLE 在Windows上编译Python脚本以供Linux使用 - Compile python script on Windows for Linux use 为什么在 Windows 机器上使用 PyCharm 时不能使用基于 Linux 的 Python 解释器? - Why can't I use a Linux-based Python interpreter when using PyCharm on a Windows machine? 如何在 celery 任务中使用 Python scalene 进行 memory 分析 - How use Python scalene for memory profiling inside a celery task 需要使用Python脚本从Linux计算机连接HP QC - Need to connect HP QC from linux machine using Python script 如何使用纯Python脚本更新/升级Linux机器 - how to update/upgrade a linux machine using pure python script 如何使用Python多处理和memory_profiler分析多个子进程? - How to profile multiple subprocesses using Python multiprocessing and memory_profiler? 使用 python 脚本在 Azure DevOps 管道上调用 Databricks API 失败,但从本地计算机在 Postman 上成功运行 - Databricks API call fails on Azure DevOps pipelines using python script, but run successfully on Postman from local machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM