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

Can't decode comm_id #586

Open
wangluochao902 opened this issue Mar 23, 2019 · 1 comment
Open

Can't decode comm_id #586

wangluochao902 opened this issue Mar 23, 2019 · 1 comment

Comments

@wangluochao902
Copy link

Hi,
I can't decode the comm_id (Unique clique id) with 'utf-8'. Can anyone tell me how to decode it?

python = 2.7.16
theano = 1.0.3
pygpu = 0.7.6

>>> import theano
Using cuDNN version 5110 on context None
Mapped name None to device cuda: Tesla K80 (0000:00:04.0)
>>> from pygpu import collectives
>>> ctx = theano.gpuarray.type.get_context(None)
>>> local_id = collectives.GpuCommCliqueId(context=ctx)
>>> comm_id = local_id.comm_id
>>> comm_id.decode('utf-8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/Tom/anaconda3/envs/theano/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 2: invalid continuation byte
>>> comm_id
bytearray(b'\x02\x00\xe4Q\n\x80\x00\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x90\xe4\xb3\x81U\x00\x00\x84v\x97|\x01\x00\x00\x00$"\x00\x00\x00\x00\x00\x00\x00w\x82\x1a\xe2\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
@wangluochao902
Copy link
Author

wangluochao902 commented Mar 23, 2019

One way to work around is to use 'iso-8859-1' instead of 'utf-8'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant