我知道我可以设置
with tf.device('/cpu:0'):
model.predict(...)
Run Code Online (Sandbox Code Playgroud)
但是,要在 Tensorflow 2.0 中使用 CPU(或 GPU),有没有办法在脚本开头设置它以独占使用 CPU?
在 Tensorflow 1.x 中可以使用
config = tf.ConfigProto(device_count = {'GPU': 0})
Run Code Online (Sandbox Code Playgroud)
但它已经贬值了。
有新的方法吗?
由于该类的文档不是很清楚。我不明白我赋予它什么价值。
cross_val_score(估算器,X,y=无)
这是我的代码:
clf = LinearSVC(random_state=seed, **params)
cvscore = cross_val_score(clf, features, labels)
Run Code Online (Sandbox Code Playgroud)
我不确定这是否正确,或者我是否需要提供 X_train 和 y_train 而不是特征和标签。
谢谢