fixed initializing CUDA device at example/mnist cnn model
This commit is contained in:
parent
7e9eb5bff2
commit
8baf32d860
|
@ -74,9 +74,8 @@ func runCNN1() {
|
||||||
testImages := ds.TestImages
|
testImages := ds.TestImages
|
||||||
testLabels := ds.TestLabels
|
testLabels := ds.TestLabels
|
||||||
|
|
||||||
cuda := gotch.CudaBuilder(0)
|
device := gotch.CudaIfAvailable()
|
||||||
vs := nn.NewVarStore(cuda.CudaIfAvailable())
|
vs := nn.NewVarStore(device)
|
||||||
// vs := nn.NewVarStore(gotch.CPU)
|
|
||||||
|
|
||||||
net := newNet(vs.Root())
|
net := newNet(vs.Root())
|
||||||
opt, err := nn.DefaultAdamConfig().Build(vs, LrCNN)
|
opt, err := nn.DefaultAdamConfig().Build(vs, LrCNN)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user