update installation script

This commit is contained in:
sugarme 2023-10-11 12:31:45 +11:00
parent 4f03dec060
commit 52d0bc412b
5 changed files with 5 additions and 18 deletions

View File

@ -24,13 +24,8 @@
## Installation
<<<<<<< HEAD
- 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`
>>>>>>> 83394ef0933537921d2765ccb5e9043671e2edb8
**NOTE**: `libtorch` will be installed at **`/usr/local/lib`**
@ -74,12 +69,8 @@
```bash
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-libtorch.sh
chmod +x setup-libtorch.sh
<<<<<<< HEAD
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
@ -96,12 +87,7 @@
```bash
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-gotch.sh
chmod +x setup-gotch.sh
<<<<<<< HEAD
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

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/sugarme/gotch
go 1.19
go 1.20
require (
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0

View File

@ -44,6 +44,7 @@ func TestOptimizer(t *testing.T) {
fmt.Printf("Loss: %.3f\n", loss.MustView([]int64{-1}, false).MustFloat64Value([]int64{0}))
}
opt.BackwardStep(loss)
loss.MustDrop()
}
loss := x.Apply(model).MustMseLoss(y, 1, true)

View File

@ -1,7 +1,7 @@
#!/bin/bash
GOTCH_VERSION="${GOTCH_VER:-v0.7.0}"
CUDA_VERSION="${CUDA_VER:-11.3}"
GOTCH_VERSION="${GOTCH_VER:-v0.8.0}"
CUDA_VERSION="${CUDA_VER:-11.8}"
if [ -z $GOPATH ]; then
GOPATH="$HOME/go"

View File

@ -1,7 +1,7 @@
#!/bin/bash
LIBTORCH_VERSION="${LIBTORCH_VER:-2.0.1}"
CUDA_VERSION="${CUDA_VER:-11.7}"
CUDA_VERSION="${CUDA_VER:-11.8}"
if [ "${CUDA_VERSION}" == "cpu" ]; then
CU_VERSION="cpu"