minitorch系列记录——1. 环境安装和机器学习基础
网页主页: github项目地址:
是2020年cornell大学的一门课程,
课程链接: 讲师介绍: 这是一个大学课程的课后作业项目,一共就:
Setup(安装环境) ML Primer ( 机器学习基础知识复习) Fundamentals Autodiff Tensors Efficiency Networks 其中,除了第二部分之外,其他部分在github上都有Public template,每次进行对应module的任务时,都需要先git clone对应的module模块,完成相应的任务
2. 任务要求 要求从这个repo中进行clone, 作业提交: 任务提交说明:https://wiki.shaiic.com/pages/viewpage.action?pageId=27688971
1. Setup(环境安装)
网页说明:https://minitorch.github.io/install.html github项目地址:https://github.com/minitorch/Module-0
个人安装记录:
要求是python3.7以上的版本,本机有conda环境,所以直接用conda创建一个新环境好了
# 创建一个名叫 minitorch的新环境 conda create -n minitorch python=3.7 # 切换到刚刚新创建的这个环境里去 conda activate minitorch # 安装额外需要的一个包 conda install llvmlite
然后根据官网的提示,需要把对应的Module 0的github项目,是一个public template,可以直接use this template,借用这个项目的模板去生成自己的内容。
然后自己找个目录,新建一个minitorch,以后这个项目都丢到这里,进入这个文件夹,然后打开git的bash,把自己账号下生成的这个module0项目git clone一下就好了,例如,我使用的就是:
cd minitorch git clone https://github.com/MachineCF/Module0.git cd Module0
之后一定要删除Module0下面的project的这个文件夹,不然后面执行的安装的时候会报错,下面是报错信息,一定要切记,把这个删除。
error: Multiple top-level packages discovered in a flat-layout: [project, minitorch]. To avoid accidental inclusion of unwanted files or directories, setuptools will not proceed with this build. If you are trying to create a single distribution with multiple packages on purpose, you should not rely on automatic discovery. Instead, consider the following options: 1. set up custom discovery (`find` directive with `include` or `exclude`) 2. use a `src-layout` 3. explicitly set `py_modules` or `packages` with a list of names To find more information, look for "package discovery" on setuptools docs.
可以直接手动删除,也可以命令行删除
rmdir /S project
之后就能简单多了
切换环境,我的环境是mini 切换路径到Modele0中
activate mini python -m pip install -r requirements.txt python -m pip install -r requirements.extra.txt python -m pip install -Ue .