update installation script
This commit is contained in:
parent
4f03dec060
commit
52d0bc412b
14
README.md
14
README.md
|
@ -24,13 +24,8 @@
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
- Default CUDA version is `11.8` if CUDA is available otherwise using CPU version.
|
- Default CUDA version is `11.8` if CUDA is available otherwise using CPU version.
|
||||||
- Default Pytorch C++ API version is `1.11.0`
|
|
||||||
=======
|
|
||||||
- Default CUDA version is `11.7` if CUDA is available otherwise using CPU version.
|
|
||||||
- Default Pytorch C++ API version is `2.0.1`
|
- Default Pytorch C++ API version is `2.0.1`
|
||||||
>>>>>>> 83394ef0933537921d2765ccb5e9043671e2edb8
|
|
||||||
|
|
||||||
**NOTE**: `libtorch` will be installed at **`/usr/local/lib`**
|
**NOTE**: `libtorch` will be installed at **`/usr/local/lib`**
|
||||||
|
|
||||||
|
@ -74,12 +69,8 @@
|
||||||
```bash
|
```bash
|
||||||
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-libtorch.sh
|
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-libtorch.sh
|
||||||
chmod +x setup-libtorch.sh
|
chmod +x setup-libtorch.sh
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
export CUDA_VER=11.8 && bash setup-libtorch.sh
|
export CUDA_VER=11.8 && bash setup-libtorch.sh
|
||||||
=======
|
|
||||||
export CUDA_VER=11.7 && bash setup-libtorch.sh
|
|
||||||
>>>>>>> 83394ef0933537921d2765ccb5e9043671e2edb8
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Update Environment**: in Debian/Ubuntu, add/update the following lines to `.bashrc` file
|
**Update Environment**: in Debian/Ubuntu, add/update the following lines to `.bashrc` file
|
||||||
|
@ -96,12 +87,7 @@
|
||||||
```bash
|
```bash
|
||||||
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-gotch.sh
|
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-gotch.sh
|
||||||
chmod +x setup-gotch.sh
|
chmod +x setup-gotch.sh
|
||||||
<<<<<<< HEAD
|
|
||||||
export CUDA_VER=11.8 && export GOTCH_VER=v0.8.0 && bash setup-gotch.sh
|
export CUDA_VER=11.8 && export GOTCH_VER=v0.8.0 && bash setup-gotch.sh
|
||||||
=======
|
|
||||||
# CUDA 11.7
|
|
||||||
export CUDA_VER=11.7 && export GOTCH_VER=v0.8.0 && bash setup-gotch.sh
|
|
||||||
>>>>>>> 83394ef0933537921d2765ccb5e9043671e2edb8
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
||||||
module github.com/sugarme/gotch
|
module github.com/sugarme/gotch
|
||||||
|
|
||||||
go 1.19
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
|
||||||
|
|
|
@ -44,6 +44,7 @@ func TestOptimizer(t *testing.T) {
|
||||||
fmt.Printf("Loss: %.3f\n", loss.MustView([]int64{-1}, false).MustFloat64Value([]int64{0}))
|
fmt.Printf("Loss: %.3f\n", loss.MustView([]int64{-1}, false).MustFloat64Value([]int64{0}))
|
||||||
}
|
}
|
||||||
opt.BackwardStep(loss)
|
opt.BackwardStep(loss)
|
||||||
|
loss.MustDrop()
|
||||||
}
|
}
|
||||||
|
|
||||||
loss := x.Apply(model).MustMseLoss(y, 1, true)
|
loss := x.Apply(model).MustMseLoss(y, 1, true)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
GOTCH_VERSION="${GOTCH_VER:-v0.7.0}"
|
GOTCH_VERSION="${GOTCH_VER:-v0.8.0}"
|
||||||
CUDA_VERSION="${CUDA_VER:-11.3}"
|
CUDA_VERSION="${CUDA_VER:-11.8}"
|
||||||
|
|
||||||
if [ -z $GOPATH ]; then
|
if [ -z $GOPATH ]; then
|
||||||
GOPATH="$HOME/go"
|
GOPATH="$HOME/go"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
LIBTORCH_VERSION="${LIBTORCH_VER:-2.0.1}"
|
LIBTORCH_VERSION="${LIBTORCH_VER:-2.0.1}"
|
||||||
CUDA_VERSION="${CUDA_VER:-11.7}"
|
CUDA_VERSION="${CUDA_VER:-11.8}"
|
||||||
|
|
||||||
if [ "${CUDA_VERSION}" == "cpu" ]; then
|
if [ "${CUDA_VERSION}" == "cpu" ]; then
|
||||||
CU_VERSION="cpu"
|
CU_VERSION="cpu"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user