Skip to content

dU1Vb/vgg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytorch-fcn

PyTorch 实现的 Fully Convolutional Networks (FCN)。

安装

git clone https://github.com/wkentaro/pytorch-fcn.git
cd pytorch-fcn
pip install .

或直接安装:

pip install torchfcn

依赖

PyTorch 版本:

  • pytorch >= 0.2.0
  • torchvision >= 0.1.8
  • fcn >= 6.1.5
  • Pillow
  • scipy
  • tqdm

MindSpore 版本:

  • mindspore
  • Pillow
  • scipy
  • tqdm

运行

PyTorch 版本

训练示例(VOC 数据集):

cd examples/voc
./download_dataset.sh
./train_fcn32s.py -g 0
./train_fcn16s.py -g 0
./train_fcn8s.py -g 0

其中 -g 参数指定使用的 GPU 编号。

MindSpore 版本

本项目已支持 MindSpore 框架,VGG16 模型已迁移至 MindSpore。

使用 MindSpore VGG16:

from torchfcn.models import vgg_mindspore

# 创建模型
model = vgg_mindspore.VGG16(pretrained=False)

# 或使用预训练权重(需先转换)
model = vgg_mindspore.VGG16(pretrained=True, pretrained_path='vgg16_mindspore.ckpt')

训练 VGG16(CIFAR-10):

cd examples/voc
python train_vgg_cifar10_mindspore.py
python train_vgg_cifar10_mindspore.py --device-target GPU  # 使用 GPU

权重转换(PyTorch → MindSpore):

python examples/voc/convert_vgg_pytorch_to_mindspore.py vgg16_from_caffe.pth vgg16_mindspore.ckpt

更多 MindSpore 使用说明请参考 examples/voc/README_mindspore.md

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages