Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Strings are encoded twice by both QRNN and Pynvrtc? #17

Open
luungoc2005 opened this issue Jul 13, 2018 · 1 comment
Open

Strings are encoded twice by both QRNN and Pynvrtc? #17

luungoc2005 opened this issue Jul 13, 2018 · 1 comment

Comments

@luungoc2005
Copy link

luungoc2005 commented Jul 13, 2018

Usually the library runs fine (I often boot up fresh cloud GPU, Ubuntu 16.04 instances on many providers), but, on one occasion - instance by SnarkAI in particular, I saw this error:

'bytes' object has no attribute 'encode'
caused by this line:

program = Program(kernel.encode(), 'recurrent_forget_mult.cu'.encode())

which calls upon the constructor in pynvrtc

Upon further inspection, it seems that pynvrtc also performs encode() of its own:

https://github.com/NVIDIA/pynvrtc/blob/fffa9f6f4a7ee1d452346cbdf68b84b5246ccffb/pynvrtc/interface.py#L200

Which calls upon the encode_str function - which encodes the string into utf-8 bytes if using python 3

However I'm also running Python 3.6 on all machines...

Removing the encode() in QRNN seems to have made it work on that machine for me - but I have to wonder 1. why only that machine had the issue and 2. would removing the .encode() in QRNN be alright for all other cases?

Edit: Apparently this is caused by this recent PR merge: NVIDIA/pynvrtc#2 Shouldn't QRNN be updated accordingly?

@threefoldo
Copy link

Thanks, removing those two 'encode' works for me. I using Python 3.5.2.

seliverstov added a commit to seliverstov/pytorch-qrnn that referenced this issue Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants