You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
change mindspore.context.set_context(device_target='CPU') to mindspore.context.set_context(device_target='GPU')
Related log / screenshot
When using GPU, we obtained this error:
Traceback (most recent call last):
File "/mnt/AA_MoCoDiff/MoCoDiff/Components/performer.py", line 84, in perform
grad, loss, output = case_file.train(inp, label)
File "/mnt/AA_MoCoDiff/MoCoDiff/./tree/tree_LeNet_n4/11/399/mindspore_gpu/LeNet-11-399_mindspore_gpu.py", line 67, in train
(ms_loss, ms_output), ms_gradients = mindspore.value_and_grad(forward_fn, None, ms_model.trainable_params(), has_aux=True)(label)
File "/root/miniconda3/envs/mocodiff/lib/python3.9/site-packages/mindspore/ops/composite/base.py", line 625, in after_grad
return grad_(fn_, weights)(*args, **kwargs)
File "/root/miniconda3/envs/mocodiff/lib/python3.9/site-packages/mindspore/common/api.py", line 121, in wrapper
results = fn(*arg, **kwargs)
File "/root/miniconda3/envs/mocodiff/lib/python3.9/site-packages/mindspore/ops/composite/base.py", line 601, in after_grad pynative_executor.grad(fn, grad, weights, grad_position, *args, **kwargs)
File "/root/miniconda3/envs/mocodiff/lib/python3.9/site-packages/mindspore/common/api.py", line 1249, in grad
self._executor.grad_net(grad, obj, weights, grad_position, *args, *(kwargs.values()))
RuntimeError: key not found
Special notes for this issue
Maybe Related to mindspore.nn.Sigmoid().
This is because it is possible to have normal operation and no differential behaviour after removing this layer.
The text was updated successfully, but these errors were encountered:
PhyllisJi
changed the title
The same code runs successfully on the cpu but fails to run on the gpu
mindspore.nn.Sigmoid() causes the code to run successfully on the CPU but fails on the GPU
May 17, 2024
Environment
Hardware Environment(
Ascend
/GPU
/CPU
):Software Environment:
Describe the current behavior
The same code runs successfully on the cpu but fails to run on the gpu。
Describe the expected behavior
Running process and results are all consistent
Steps to reproduce the issue
change
mindspore.context.set_context(device_target='CPU')
tomindspore.context.set_context(device_target='GPU')
Related log / screenshot
When using GPU, we obtained this error:
Special notes for this issue
Maybe Related to mindspore.nn.Sigmoid().
This is because it is possible to have normal operation and no differential behaviour after removing this layer.
The text was updated successfully, but these errors were encountered: