Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

muti_gpu_model not supported in crf loss[BUG] #174

Open
ZhyiXu opened this issue Jul 23, 2019 · 4 comments
Open

muti_gpu_model not supported in crf loss[BUG] #174

ZhyiXu opened this issue Jul 23, 2019 · 4 comments
Assignees
Labels
bug Something isn't working pinned

Comments

@ZhyiXu
Copy link

ZhyiXu commented Jul 23, 2019

File "/root/ubuntu/software/anaconda3/lib/python3.7/site-packages/kashgari/utils/crf/crf_losses.py", line 71, in crf_loss
if crf.learn_mode == 'join':
AttributeError: 'Concatenate' object has no attribute 'learn_mode'

@stale

This comment has been minimized.

@stale stale bot added the wontfix This will not be worked on label Sep 19, 2019
@BrikerMan BrikerMan added pinned and removed wontfix This will not be worked on labels Sep 19, 2019
@BrikerMan
Copy link
Owner

@CyberZHG could you help me with the issue. I don't know how to implement a multi-GPU / TPU supported layer.

@CyberZHG
Copy link
Contributor

You don't need to do anything to support multi-GPU. It's because this implementation of CRF layer must be the last layer in 'join' mode. However, a concatenation layer will be created to merge the outputs (from CRF layers) from different GPUs.

@CyberZHG
Copy link
Contributor

I think one way to use this CRF for multi-GPU in 'join' mode is:

  • Build the model without the CRF
  • Convert to multi-GPU model
  • Add CRF layer to the output of the multi-GPU model in CPU context
  • Compile the model with the CRF loss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned
Projects
None yet
Development

No branches or pull requests

3 participants