zoukankan      html  css  js  c++  java
  • Python2.7+virtualenv+CUDA 10.0版的pytorch v1.3.0 +运行人群计数crowdcount-mcnn网络

    Python2.7
    $ python2 -m virtualenv pytorchenv
    $ source pytorchenv/bin/activate
    $ pip install ipython
    pytorch v1.3.0 # CUDA 10.0
    $ pip install torch==1.3.0+cu100 torchvision==0.4.1+cu100 -f https://download.pytorch.org/whl/torch_stable.html

    ........................................................................................................................
    Downloading https://download.pytorch.org/whl/cu100/torch-1.3.0%2Bcu100-cp27-cp27mu-linux_x86_64.whl (744.5MB)
    Downloading https://download.pytorch.org/whl/cu100/torchvision-0.4.1%2Bcu100-cp27-cp27mu-linux_x86_64.whl (10.1MB)
    ......................................................................................................................

    $ pip install ipython
    或打开pycharm
    ====输入例子====
    import torch as t
    x = t.rand(5,3)
    y = t.rand(5,3)
    if t.cuda.is_available():
        x = x.cuda()
        y = y.cuda()
        print(x+y)
    =====有结果代表成功====

    crowdcount-mcnn人群计数https://github.com/svishwa/crowdcount-mcnn,需要额外安装依赖:
    pip2 install pandas
    pip2 install opencv-python
    pip2 install h5py
    注意修改train.py代码:
    # train_loss += loss.data[0] is pytorch0.3.1 codes, and >pytorch0.5 is error.
    train_loss += loss.item()

  • 相关阅读:
    CRLF注入
    Windows下消息中间件RabbitMQ安装教程(超详细)
    (超详细)SpringBoot+RabbitMQ+Stomp+JS实现前端消息推送
    数数塔 NBUT 1083
    数数塔 NBUT 1083
    数塔 HDU 2084
    数塔 HDU 2084
    数塔 HDU 2084
    递推
    递推
  • 原文地址:https://www.cnblogs.com/jeshy/p/11747847.html
Copyright © 2011-2022 走看看