李宏毅2025秋季机器学习作业 GenAI-ML-HW1-Understand the fundamentals of GenAI实操
本文介绍了三种获取和运行机器学习实操作业的方法:1) 通过Google Colab复制脚本并运行;2) 通过Kaggle导入、编辑并切换GPU运行;3) 下载到本地后在VSCode中运行,包括配置Anaconda环境、Jupyter Lab以及解决目录设置问题。文中还提到3090显卡无法运行的情况,但未给出具体解决方案。
·
1.通过colab获取实操作业
1.1 源脚本
https://colab.research.google.com/drive/1PjLpwbhy8A6AMugfCJZGVZwjacBfszgk?usp=sharing
1.2 复制到自己的colab
2.通过kaggle
2.1 导入
2.2 编辑
2.3 切换gpu运行
3.通过kaggle
3.1 导入
3.2 编辑
3.3 切换gpu运行
3 通过本地vscode
3.1 通过colab下载到本地
3.2 通过kaggle下载到本地
3.3 本地环境运行调试
3.3.1 anaconda环境
3.3.2 jupyter lab
(myenvp) G:\dl\ml2025\jpynb>jupyter lab
[I 2025-09-27 12:10:20.859 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2025-09-27 12:10:20.866 ServerApp] jupyter_server_terminals | extension was successfully linked.
[W 2025-09-27 12:10:20.882 ServerApp] notebook_dir is deprecated, use root_dir
[I 2025-09-27 12:10:20.882 ServerApp] jupyterlab | extension was successfully linked.
[I 2025-09-27 12:10:21.281 ServerApp] notebook_shim | extension was successfully linked.
[I 2025-09-27 12:10:21.316 ServerApp] notebook_shim | extension was successfully loaded.
[I 2025-09-27 12:10:21.318 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2025-09-27 12:10:21.319 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2025-09-27 12:10:21.323 LabApp] JupyterLab extension loaded from D:\anaconda3\envs\myenvp\lib\site-packages\jupyterlab
[I 2025-09-27 12:10:21.323 LabApp] JupyterLab application directory is D:\anaconda3\envs\myenvp\share\jupyter\lab
[I 2025-09-27 12:10:21.324 LabApp] Extension Manager is 'pypi'.
[I 2025-09-27 12:10:21.837 ServerApp] jupyterlab | extension was successfully loaded.
[I 2025-09-27 12:10:21.838 ServerApp] Serving notebooks from local directory: G:\dl\ml2025\jpynb
[I 2025-09-27 12:10:21.838 ServerApp] Jupyter Server 2.17.0 is running at:
[I 2025-09-27 12:10:21.838 ServerApp] http://localhost:8888/lab?token=f0145747f81a7d82a18bff2c40881db8d603a7ef722a5a90
[I 2025-09-27 12:10:21.838 ServerApp] http://127.0.0.1:8888/lab?token=f0145747f81a7d82a18bff2c40881db8d603a7ef722a5a90
[I 2025-09-27 12:10:21.839 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2025-09-27 12:10:21.922 ServerApp]
To access the server, open this file in a browser:
file:///C:/Users/Administrator/AppData/Roaming/jupyter/runtime/jpserver-2780-open.html
Or copy and paste one of these URLs:
http://localhost:8888/lab?token=f0145747f81a7d82a18bff2c40881db8d603a7ef722a5a90
http://127.0.0.1:8888/lab?token=f0145747f81a7d82a18bff2c40881db8d603a7ef722a5a90
3.3.3 vscode
将http://127.0.0.1:8888/lab?token=f0145747f81a7d82a18bff2c40881db8d603a7ef722a5a90填入
然后命名一个名字
3.3.4 解决jupyterlab修改默认目录的问题
jupyter lab --generate-config
C:\Users\Administrator.jupyter
使用电脑自带的记事本打开jupyter_lab_config.py文件:
Ctrl+F搜索找到c.ServerApp.notebook_dir = ''这一行
c.ServerApp.notebook_dir = ‘G:\dl\ml2025\jpynb’
3.3.5 解决huggingface修改默认目录的问题
使用Windows的命令提示符(CMD)
setx HF_HOME “G:\huggingface\hub”
需要重新打开命令提示符窗口才能生效。
3.3.6 发现3090无法运行
更多推荐
所有评论(0)