diff --git a/README.md b/README.md index 5b7f6a0..f31d191 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/go.mod b/go.mod index 5ec0e19..6248e03 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/nn/optimizer_test.go b/nn/optimizer_test.go index 9072b4d..8df7af6 100644 --- a/nn/optimizer_test.go +++ b/nn/optimizer_test.go @@ -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) diff --git a/setup-gotch.sh b/setup-gotch.sh index c1dce86..1fea856 100644 --- a/setup-gotch.sh +++ b/setup-gotch.sh @@ -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" diff --git a/setup-libtorch.sh b/setup-libtorch.sh index 87982bb..11693c9 100644 --- a/setup-libtorch.sh +++ b/setup-libtorch.sh @@ -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"