目录
目录README

第三届Jittor挑战赛及计算机图形学课程PA3

1. Introduction

这是计算机图形学课程第三次作业,也是第三届计图挑战赛的热身赛。该仓库用于完成相关代码的开源工作。本仓库仅有一个代码文件CGAN.py,该代码设计了一个简单的CGAN网络,基于MNIST数据集可用于生成手写数字图片。

2. Dependencies

本次作业需要使用Jittor框架,请确保安装了Jittor框架:

环境条件要求:
操作系统: Ubuntu >= 16.04 或 Windows Subsystem of Linux(WSL)
Python:版本 >= 3.7
C++编译器 (需要下列至少一个)
g++ (>=5.4.0)
clang (>=8.0)
GPU 编译器(可选):nvcc >=10.0
GPU 加速库(可选):cudnn-dev(或cudnn)

下面提供两种安装方式:使用pip安装或手动安装:

Pip安装

sudo apt install python3.7-dev libomp-dev
python3.7 -m pip install jittor
python3.7 -m jittor.test.test_example ## 验证安装

手动安装

  1. 安装编译器
# g++
sudo apt install g++ build-essential libomp-dev

# OR clang++-8
wget -O - https://raw.githubusercontent.com/Jittor/jittor/master/script/install_llvm.sh > /tmp/llvm.sh
bash /tmp/llvm.sh 8
  1. 安装python
sudo apt install python3.7 python3.7-dev
  1. 运行Jittor
git clone https://github.com/Jittor/jittor.git
sudo pip3.7 install ./jittor
export cc_path="g++"
## or 
export cc_path="clang++-8" 
## if you use clang++

# run a simple test
python3.7 -m jittor.test.test_example
  1. 启用CUDA加速(可选)
export nvcc_path="/usr/local/cuda/bin/nvcc" 
# run a simple cuda test
python3.7 -m jittor.test.test_cuda 

若通过测试,则可以在代码中添加如下内容以启用CUDA:

import jittor as jt
jt.flags.use_cuda = 1
  1. 测试训练 您可以通过运行Resnet18训练测试来检查Jittor的完整性。
python3.7 -m jittor.test.test_resnet

3. Usage

代码会自动下载MNIST数据集,仅运行

python CGAN.py

即可开始训练,你可以实时查看训练结果。

关于

这是热身赛,A Jittor implementation of Conditional GAN (CGAN)

36.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号