官网深度学习特征裁剪值如何设置原代码报错?
由huasan2021创建,最终由small_q 被浏览 13 用户
根据官网深度学习特征裁剪值如何设置?的原代码(https://bigquant.com/wiki/doc/shendu-tezheng-EuCMiohTql),运行报错<ValueError: optimizer function should't be none.>请问什么原因?如何解决?
https://bigquant.com/experimentshare/175b607bae904740a1034e7ba1b29c4e
\
评论
- torch版本升级 导致一些接口有变化
参照我图片改下这四行就可以啦
![{w:100}](/wiki/api/attachments.redirect?id=06f36734-ab9a-430b-8a87-1743ebc723ac)
- 已安截图内容进行修改,报错:
---
RuntimeError Traceback (most recent call last)
in
371 )
372
\--> 373 m33 = M.cached.v3(
374 input_1=m2.data,
375 input_2=m32.data,
in m33_run_bigquant_run(input_1, input_2, input_3)
18 optimizer = torch.optim.Adam(model.parameters(),lr=5e-4)
19 loss_func = nn.MSELoss()
\---> 20 model.compile(device="cuda:0",optimizer=optimizer,loss=loss_func)
21 # model.fit(x_train, y_train, val_data=(x_val, y_val), batch_size=1024, epochs=10, verbose=1, num_workers=2)
22 model.fit(x_train, y_train, validation_data==(x_val, y_val), batch_size=1024, epochs=10, verbose=1, num_workers=2)
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from
[https://bigquant.com/experimentshare/b96e89e2808b427f9021fae32424ab51](https://bigquant.com/experimentshare/b96e89e2808b427f9021fae32424ab51)
\
- 提示找不到GPU驱动,编译那一行这么改:
model.compile(optimizer=optimizer,loss=loss_func)