-
Notifications
You must be signed in to change notification settings - Fork 5.4k
decode the output of get_command_stdout if not str #1646
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
danpovey
added a commit
that referenced
this pull request
May 29, 2017
Contributor
|
This did not work, it crashed the scripts. I changed it to: which I now realize is not very clear because any string would have been OK, not just 'str'. |
Contributor
Author
|
Thanks for letting me know. That is strange because:
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>> type('hello') is str
True
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>> type('hello') is str
True
How would you like to make modify this to make it more clear?
Regards,
Omid
…On Mon, May 29, 2017 at 7:37 PM, Daniel Povey ***@***.***> wrote:
This did not work, it crashed the scripts.
LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw neural net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
Traceback (most recent call last):
File "steps/nnet3/xconfig_to_configs.py", line 306, in <module>
main()
File "steps/nnet3/xconfig_to_configs.py", line 301, in main
check_model_contexts(args.config_dir, args.nnet_edits)
File "steps/nnet3/xconfig_to_configs.py", line 265, in check_model_contexts
.format(model))
File "steps/libs/common.py", line 117, in get_command_stdout
return stdout if type(stdout) is str else stdout.decode()
UnboundLocalError: local variable 'str' referenced before assignment
I changed it to:
return stdout if type(stdout) is type('str') else stdout.decode()
which I now realize is not very clear because any string would have been
OK, not just 'str'.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AP60-MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
.
|
Contributor
|
There is a local variable in that function called 'str'.
Maybe that could be renamed to something like 'output' and you could change
it back to "is str".
…On Mon, May 29, 2017 at 8:40 PM, osadj ***@***.***> wrote:
Thanks for letting me know. That is strange because:
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> type('hello') is str
True
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> type('hello') is str
True
How would you like to make modify this to make it more clear?
Regards,
Omid
On Mon, May 29, 2017 at 7:37 PM, Daniel Povey ***@***.***>
wrote:
> This did not work, it crashed the scripts.
>
> LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw neural
net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
> nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
> Traceback (most recent call last):
> File "steps/nnet3/xconfig_to_configs.py", line 306, in <module>
> main()
> File "steps/nnet3/xconfig_to_configs.py", line 301, in main
> check_model_contexts(args.config_dir, args.nnet_edits)
> File "steps/nnet3/xconfig_to_configs.py", line 265, in
check_model_contexts
> .format(model))
> File "steps/libs/common.py", line 117, in get_command_stdout
> return stdout if type(stdout) is str else stdout.decode()
> UnboundLocalError: local variable 'str' referenced before assignment
>
> I changed it to:
>
> return stdout if type(stdout) is type('str') else stdout.decode()
>
> which I now realize is not very clear because any string would have been
> OK, not just 'str'.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1646 (comment)>,
or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AP60-
MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
> .
>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADJVuwF3XOMK-sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
.
|
Contributor
|
there is python's package types that exports
types.StringType
types.UnicodeType
which I think might be more clear to use
y.
On Mon, May 29, 2017 at 8:43 PM, Daniel Povey <[email protected]>
wrote:
… There is a local variable in that function called 'str'.
Maybe that could be renamed to something like 'output' and you could change
it back to "is str".
On Mon, May 29, 2017 at 8:40 PM, osadj ***@***.***> wrote:
> Thanks for letting me know. That is strange because:
>
> Python 3.5.2 (default, Nov 17 2016, 17:05:23)
> [GCC 5.4.0 20160609] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> type('hello') is str
> True
>
> Python 2.7.12 (default, Nov 19 2016, 06:48:10)
> [GCC 5.4.0 20160609] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> type('hello') is str
> True
>
> How would you like to make modify this to make it more clear?
>
> Regards,
> Omid
>
> On Mon, May 29, 2017 at 7:37 PM, Daniel Povey ***@***.***>
> wrote:
>
> > This did not work, it crashed the scripts.
> >
> > LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw neural
> net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
> > nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
> > Traceback (most recent call last):
> > File "steps/nnet3/xconfig_to_configs.py", line 306, in <module>
> > main()
> > File "steps/nnet3/xconfig_to_configs.py", line 301, in main
> > check_model_contexts(args.config_dir, args.nnet_edits)
> > File "steps/nnet3/xconfig_to_configs.py", line 265, in
> check_model_contexts
> > .format(model))
> > File "steps/libs/common.py", line 117, in get_command_stdout
> > return stdout if type(stdout) is str else stdout.decode()
> > UnboundLocalError: local variable 'str' referenced before assignment
> >
> > I changed it to:
> >
> > return stdout if type(stdout) is type('str') else stdout.decode()
> >
> > which I now realize is not very clear because any string would have
been
> > OK, not just 'str'.
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub
> > <#1646 (comment)>,
> or mute
> > the thread
> > <https://github.com/notifications/unsubscribe-auth/AP60-
> MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
> > .
> >
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <#1646 (comment)>,
or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/ADJVuwF3XOMK-
sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
> .
>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKisX66gxr1zxFEsE-4rST-Ve8XSZLiuks5r-2Y4gaJpZM4NoAei>
.
|
Contributor
Author
|
I like this. Thanks, Yenda.
…On Mon, May 29, 2017 at 8:48 PM, jtrmal ***@***.***> wrote:
there is python's package types that exports
types.StringType
types.UnicodeType
which I think might be more clear to use
y.
On Mon, May 29, 2017 at 8:43 PM, Daniel Povey ***@***.***>
wrote:
> There is a local variable in that function called 'str'.
> Maybe that could be renamed to something like 'output' and you could
change
> it back to "is str".
>
>
>
> On Mon, May 29, 2017 at 8:40 PM, osadj ***@***.***> wrote:
>
> > Thanks for letting me know. That is strange because:
> >
> > Python 3.5.2 (default, Nov 17 2016, 17:05:23)
> > [GCC 5.4.0 20160609] on linux
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> type('hello') is str
> > True
> >
> > Python 2.7.12 (default, Nov 19 2016, 06:48:10)
> > [GCC 5.4.0 20160609] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> type('hello') is str
> > True
> >
> > How would you like to make modify this to make it more clear?
> >
> > Regards,
> > Omid
> >
> > On Mon, May 29, 2017 at 7:37 PM, Daniel Povey <
***@***.***>
> > wrote:
> >
> > > This did not work, it crashed the scripts.
> > >
> > > LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw neural
> > net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
> > > nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
> > > Traceback (most recent call last):
> > > File "steps/nnet3/xconfig_to_configs.py", line 306, in <module>
> > > main()
> > > File "steps/nnet3/xconfig_to_configs.py", line 301, in main
> > > check_model_contexts(args.config_dir, args.nnet_edits)
> > > File "steps/nnet3/xconfig_to_configs.py", line 265, in
> > check_model_contexts
> > > .format(model))
> > > File "steps/libs/common.py", line 117, in get_command_stdout
> > > return stdout if type(stdout) is str else stdout.decode()
> > > UnboundLocalError: local variable 'str' referenced before assignment
> > >
> > > I changed it to:
> > >
> > > return stdout if type(stdout) is type('str') else stdout.decode()
> > >
> > > which I now realize is not very clear because any string would have
> been
> > > OK, not just 'str'.
> > >
> > > —
> > > You are receiving this because you authored the thread.
> > > Reply to this email directly, view it on GitHub
> > > <#1646 (comment)
>,
> > or mute
> > > the thread
> > > <https://github.com/notifications/unsubscribe-auth/AP60-
> > MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
> > > .
> > >
> >
> > —
> > You are receiving this because you modified the open/close state.
> > Reply to this email directly, view it on GitHub
> > <#1646 (comment)>,
> or mute
> > the thread
> > <https://github.com/notifications/unsubscribe-auth/ADJVuwF3XOMK-
> sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
> > .
>
> >
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#1646 (comment)>,
or mute
> the thread
> <https://github.com/notifications/unsubscribe-
auth/AKisX66gxr1zxFEsE-4rST-Ve8XSZLiuks5r-2Y4gaJpZM4NoAei>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AP60-GeK3EYHlhLpnTgZaOzsRP50K7gwks5r-2dfgaJpZM4NoAei>
.
|
Contributor
Author
|
I take that back. This is no longer available (and recommended) in Python3.
On Mon, May 29, 2017 at 8:50 PM, Omid Sadjadi <[email protected]>
wrote:
… I like this. Thanks, Yenda.
On Mon, May 29, 2017 at 8:48 PM, jtrmal ***@***.***> wrote:
> there is python's package types that exports
> types.StringType
> types.UnicodeType
> which I think might be more clear to use
> y.
>
> On Mon, May 29, 2017 at 8:43 PM, Daniel Povey ***@***.***>
>
> wrote:
>
> > There is a local variable in that function called 'str'.
> > Maybe that could be renamed to something like 'output' and you could
> change
> > it back to "is str".
> >
> >
> >
> > On Mon, May 29, 2017 at 8:40 PM, osadj ***@***.***>
> wrote:
> >
> > > Thanks for letting me know. That is strange because:
> > >
> > > Python 3.5.2 (default, Nov 17 2016, 17:05:23)
> > > [GCC 5.4.0 20160609] on linux
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > >>> type('hello') is str
> > > True
> > >
> > > Python 2.7.12 (default, Nov 19 2016, 06:48:10)
> > > [GCC 5.4.0 20160609] on linux2
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > >>> type('hello') is str
> > > True
> > >
> > > How would you like to make modify this to make it more clear?
> > >
> > > Regards,
> > > Omid
> > >
> > > On Mon, May 29, 2017 at 7:37 PM, Daniel Povey <
> ***@***.***>
> > > wrote:
> > >
> > > > This did not work, it crashed the scripts.
> > > >
> > > > LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw
> neural
> > > net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
> > > > nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
> > > > Traceback (most recent call last):
> > > > File "steps/nnet3/xconfig_to_configs.py", line 306, in <module>
> > > > main()
> > > > File "steps/nnet3/xconfig_to_configs.py", line 301, in main
> > > > check_model_contexts(args.config_dir, args.nnet_edits)
> > > > File "steps/nnet3/xconfig_to_configs.py", line 265, in
> > > check_model_contexts
> > > > .format(model))
> > > > File "steps/libs/common.py", line 117, in get_command_stdout
> > > > return stdout if type(stdout) is str else stdout.decode()
> > > > UnboundLocalError: local variable 'str' referenced before assignment
> > > >
> > > > I changed it to:
> > > >
> > > > return stdout if type(stdout) is type('str') else stdout.decode()
> > > >
> > > > which I now realize is not very clear because any string would have
> > been
> > > > OK, not just 'str'.
> > > >
> > > > —
> > > > You are receiving this because you authored the thread.
> > > > Reply to this email directly, view it on GitHub
> > > > <#1646 (comment)
> 04744273>,
> > > or mute
> > > > the thread
> > > > <https://github.com/notifications/unsubscribe-auth/AP60-
> > > MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
> > > > .
> > > >
> > >
> > > —
> > > You are receiving this because you modified the open/close state.
> > > Reply to this email directly, view it on GitHub
> > > <#1646 (comment)
> >,
> > or mute
> > > the thread
> > > <https://github.com/notifications/unsubscribe-auth/ADJVuwF3XOMK-
> > sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
> > > .
> >
> > >
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <#1646 (comment)>,
> or mute
> > the thread
> > <https://github.com/notifications/unsubscribe-auth/
> AKisX66gxr1zxFEsE-4rST-Ve8XSZLiuks5r-2Y4gaJpZM4NoAei>
>
> > .
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1646 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AP60-GeK3EYHlhLpnTgZaOzsRP50K7gwks5r-2dfgaJpZM4NoAei>
> .
>
|
Contributor
|
In that case, I think it's fine to ignore python3 as the developers are
idiots
y.
…On Mon, May 29, 2017 at 8:56 PM, osadj ***@***.***> wrote:
I take that back. This is no longer available (and recommended) in Python3.
On Mon, May 29, 2017 at 8:50 PM, Omid Sadjadi ***@***.***>
wrote:
> I like this. Thanks, Yenda.
>
> On Mon, May 29, 2017 at 8:48 PM, jtrmal ***@***.***>
wrote:
>
>> there is python's package types that exports
>> types.StringType
>> types.UnicodeType
>> which I think might be more clear to use
>> y.
>>
>> On Mon, May 29, 2017 at 8:43 PM, Daniel Povey ***@***.***
>
>>
>> wrote:
>>
>> > There is a local variable in that function called 'str'.
>> > Maybe that could be renamed to something like 'output' and you could
>> change
>> > it back to "is str".
>> >
>> >
>> >
>> > On Mon, May 29, 2017 at 8:40 PM, osadj ***@***.***>
>> wrote:
>> >
>> > > Thanks for letting me know. That is strange because:
>> > >
>> > > Python 3.5.2 (default, Nov 17 2016, 17:05:23)
>> > > [GCC 5.4.0 20160609] on linux
>> > > Type "help", "copyright", "credits" or "license" for more
information.
>> > > >>> type('hello') is str
>> > > True
>> > >
>> > > Python 2.7.12 (default, Nov 19 2016, 06:48:10)
>> > > [GCC 5.4.0 20160609] on linux2
>> > > Type "help", "copyright", "credits" or "license" for more
information.
>> > > >>> type('hello') is str
>> > > True
>> > >
>> > > How would you like to make modify this to make it more clear?
>> > >
>> > > Regards,
>> > > Omid
>> > >
>> > > On Mon, May 29, 2017 at 7:37 PM, Daniel Povey <
>> ***@***.***>
>> > > wrote:
>> > >
>> > > > This did not work, it crashed the scripts.
>> > > >
>> > > > LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw
>> neural
>> > > net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
>> > > > nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
>> > > > Traceback (most recent call last):
>> > > > File "steps/nnet3/xconfig_to_configs.py", line 306, in <module>
>> > > > main()
>> > > > File "steps/nnet3/xconfig_to_configs.py", line 301, in main
>> > > > check_model_contexts(args.config_dir, args.nnet_edits)
>> > > > File "steps/nnet3/xconfig_to_configs.py", line 265, in
>> > > check_model_contexts
>> > > > .format(model))
>> > > > File "steps/libs/common.py", line 117, in get_command_stdout
>> > > > return stdout if type(stdout) is str else stdout.decode()
>> > > > UnboundLocalError: local variable 'str' referenced before
assignment
>> > > >
>> > > > I changed it to:
>> > > >
>> > > > return stdout if type(stdout) is type('str') else stdout.decode()
>> > > >
>> > > > which I now realize is not very clear because any string would
have
>> > been
>> > > > OK, not just 'str'.
>> > > >
>> > > > —
>> > > > You are receiving this because you authored the thread.
>> > > > Reply to this email directly, view it on GitHub
>> > > > <#1646 (comment)
>> 04744273>,
>> > > or mute
>> > > > the thread
>> > > > <https://github.com/notifications/unsubscribe-auth/AP60-
>> > > MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
>> > > > .
>> > > >
>> > >
>> > > —
>> > > You are receiving this because you modified the open/close state.
>> > > Reply to this email directly, view it on GitHub
>> > > <#1646 (comment)-
304748964
>> >,
>> > or mute
>> > > the thread
>> > > <https://github.com/notifications/unsubscribe-auth/ADJVuwF3XOMK-
>> > sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
>> > > .
>> >
>> > >
>> >
>> > —
>> > You are receiving this because you are subscribed to this thread.
>> > Reply to this email directly, view it on GitHub
>> > <#1646 (comment)
>,
>> or mute
>> > the thread
>> > <https://github.com/notifications/unsubscribe-auth/
>> AKisX66gxr1zxFEsE-4rST-Ve8XSZLiuks5r-2Y4gaJpZM4NoAei>
>>
>> > .
>> >
>>
>> —
>> You are receiving this because you authored the thread.
>> Reply to this email directly, view it on GitHub
>> <#1646 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AP60-
GeK3EYHlhLpnTgZaOzsRP50K7gwks5r-2dfgaJpZM4NoAei>
>> .
>>
>
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKisXxkUO3XNWEydQ-wols3EWrxxUGTXks5r-2k4gaJpZM4NoAei>
.
|
Contributor
|
It's OK, the solution he had originally was fine ("is str"), it works in
both; the only issue was there was a local variable named str which should
be renamed.
…On Mon, May 29, 2017 at 9:00 PM, jtrmal ***@***.***> wrote:
In that case, I think it's fine to ignore python3 as the developers are
idiots
y.
On Mon, May 29, 2017 at 8:56 PM, osadj ***@***.***> wrote:
> I take that back. This is no longer available (and recommended) in
Python3.
>
>
>
> On Mon, May 29, 2017 at 8:50 PM, Omid Sadjadi ***@***.***>
> wrote:
>
>
> > I like this. Thanks, Yenda.
> >
> > On Mon, May 29, 2017 at 8:48 PM, jtrmal ***@***.***>
> wrote:
> >
> >> there is python's package types that exports
> >> types.StringType
> >> types.UnicodeType
> >> which I think might be more clear to use
> >> y.
> >>
> >> On Mon, May 29, 2017 at 8:43 PM, Daniel Povey <
***@***.***
> >
> >>
> >> wrote:
> >>
> >> > There is a local variable in that function called 'str'.
> >> > Maybe that could be renamed to something like 'output' and you could
> >> change
> >> > it back to "is str".
> >> >
> >> >
> >> >
> >> > On Mon, May 29, 2017 at 8:40 PM, osadj ***@***.***>
> >> wrote:
> >> >
> >> > > Thanks for letting me know. That is strange because:
> >> > >
> >> > > Python 3.5.2 (default, Nov 17 2016, 17:05:23)
> >> > > [GCC 5.4.0 20160609] on linux
> >> > > Type "help", "copyright", "credits" or "license" for more
> information.
> >> > > >>> type('hello') is str
> >> > > True
> >> > >
> >> > > Python 2.7.12 (default, Nov 19 2016, 06:48:10)
> >> > > [GCC 5.4.0 20160609] on linux2
> >> > > Type "help", "copyright", "credits" or "license" for more
> information.
> >> > > >>> type('hello') is str
> >> > > True
> >> > >
> >> > > How would you like to make modify this to make it more clear?
> >> > >
> >> > > Regards,
> >> > > Omid
> >> > >
> >> > > On Mon, May 29, 2017 at 7:37 PM, Daniel Povey <
> >> ***@***.***>
> >> > > wrote:
> >> > >
> >> > > > This did not work, it crashed the scripts.
> >> > > >
> >> > > > LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw
> >> neural
> >> > > net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
> >> > > > nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
> >> > > > Traceback (most recent call last):
> >> > > > File "steps/nnet3/xconfig_to_configs.py", line 306, in <module>
> >> > > > main()
> >> > > > File "steps/nnet3/xconfig_to_configs.py", line 301, in main
> >> > > > check_model_contexts(args.config_dir, args.nnet_edits)
> >> > > > File "steps/nnet3/xconfig_to_configs.py", line 265, in
> >> > > check_model_contexts
> >> > > > .format(model))
> >> > > > File "steps/libs/common.py", line 117, in get_command_stdout
> >> > > > return stdout if type(stdout) is str else stdout.decode()
> >> > > > UnboundLocalError: local variable 'str' referenced before
> assignment
> >> > > >
> >> > > > I changed it to:
> >> > > >
> >> > > > return stdout if type(stdout) is type('str') else
stdout.decode()
> >> > > >
> >> > > > which I now realize is not very clear because any string would
> have
> >> > been
> >> > > > OK, not just 'str'.
> >> > > >
> >> > > > —
> >> > > > You are receiving this because you authored the thread.
> >> > > > Reply to this email directly, view it on GitHub
> >> > > > <#1646 (comment)
> >> 04744273>,
> >> > > or mute
> >> > > > the thread
> >> > > > <https://github.com/notifications/unsubscribe-auth/AP60-
> >> > > MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
> >> > > > .
> >> > > >
> >> > >
> >> > > —
> >> > > You are receiving this because you modified the open/close state.
> >> > > Reply to this email directly, view it on GitHub
> >> > > <#1646 (comment)-
> 304748964
> >> >,
> >> > or mute
> >> > > the thread
> >> > > <https://github.com/notifications/unsubscribe-auth/ADJVuwF3XOMK-
> >> > sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
> >> > > .
> >> >
> >> > >
> >> >
> >> > —
> >> > You are receiving this because you are subscribed to this thread.
> >> > Reply to this email directly, view it on GitHub
> >> > <#1646 (comment)-
304749149
> >,
> >> or mute
> >> > the thread
> >> > <https://github.com/notifications/unsubscribe-auth/
> >> AKisX66gxr1zxFEsE-4rST-Ve8XSZLiuks5r-2Y4gaJpZM4NoAei>
> >>
> >> > .
> >> >
> >>
> >> —
> >> You are receiving this because you authored the thread.
> >> Reply to this email directly, view it on GitHub
> >> <#1646 (comment)
>,
> >> or mute the thread
> >> <https://github.com/notifications/unsubscribe-auth/AP60-
> GeK3EYHlhLpnTgZaOzsRP50K7gwks5r-2dfgaJpZM4NoAei>
> >> .
> >>
> >
> >
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#1646 (comment)>,
or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AKisXxkUO3XNWEydQ-
wols3EWrxxUGTXks5r-2k4gaJpZM4NoAei>
> .
>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADJVuwS3IzoMFbTzzmVBlrWRkGQrCMvcks5r-2odgaJpZM4NoAei>
.
|
Contributor
Author
|
Sounds good. Should I make a PR then?
On Mon, May 29, 2017 at 9:02 PM, Daniel Povey <[email protected]>
wrote:
… It's OK, the solution he had originally was fine ("is str"), it works in
both; the only issue was there was a local variable named str which should
be renamed.
On Mon, May 29, 2017 at 9:00 PM, jtrmal ***@***.***> wrote:
> In that case, I think it's fine to ignore python3 as the developers are
> idiots
> y.
>
>
> On Mon, May 29, 2017 at 8:56 PM, osadj ***@***.***> wrote:
>
> > I take that back. This is no longer available (and recommended) in
> Python3.
> >
> >
> >
> > On Mon, May 29, 2017 at 8:50 PM, Omid Sadjadi <
***@***.***>
> > wrote:
> >
> >
> > > I like this. Thanks, Yenda.
> > >
> > > On Mon, May 29, 2017 at 8:48 PM, jtrmal ***@***.***>
> > wrote:
> > >
> > >> there is python's package types that exports
> > >> types.StringType
> > >> types.UnicodeType
> > >> which I think might be more clear to use
> > >> y.
> > >>
> > >> On Mon, May 29, 2017 at 8:43 PM, Daniel Povey <
> ***@***.***
> > >
> > >>
> > >> wrote:
> > >>
> > >> > There is a local variable in that function called 'str'.
> > >> > Maybe that could be renamed to something like 'output' and you
could
> > >> change
> > >> > it back to "is str".
> > >> >
> > >> >
> > >> >
> > >> > On Mon, May 29, 2017 at 8:40 PM, osadj ***@***.***>
> > >> wrote:
> > >> >
> > >> > > Thanks for letting me know. That is strange because:
> > >> > >
> > >> > > Python 3.5.2 (default, Nov 17 2016, 17:05:23)
> > >> > > [GCC 5.4.0 20160609] on linux
> > >> > > Type "help", "copyright", "credits" or "license" for more
> > information.
> > >> > > >>> type('hello') is str
> > >> > > True
> > >> > >
> > >> > > Python 2.7.12 (default, Nov 19 2016, 06:48:10)
> > >> > > [GCC 5.4.0 20160609] on linux2
> > >> > > Type "help", "copyright", "credits" or "license" for more
> > information.
> > >> > > >>> type('hello') is str
> > >> > > True
> > >> > >
> > >> > > How would you like to make modify this to make it more clear?
> > >> > >
> > >> > > Regards,
> > >> > > Omid
> > >> > >
> > >> > > On Mon, May 29, 2017 at 7:37 PM, Daniel Povey <
> > >> ***@***.***>
> > >> > > wrote:
> > >> > >
> > >> > > > This did not work, it crashed the scripts.
> > >> > > >
> > >> > > > LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized raw
> > >> neural
> > >> > > net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
> > >> > > > nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
> > >> > > > Traceback (most recent call last):
> > >> > > > File "steps/nnet3/xconfig_to_configs.py", line 306, in
<module>
> > >> > > > main()
> > >> > > > File "steps/nnet3/xconfig_to_configs.py", line 301, in main
> > >> > > > check_model_contexts(args.config_dir, args.nnet_edits)
> > >> > > > File "steps/nnet3/xconfig_to_configs.py", line 265, in
> > >> > > check_model_contexts
> > >> > > > .format(model))
> > >> > > > File "steps/libs/common.py", line 117, in get_command_stdout
> > >> > > > return stdout if type(stdout) is str else stdout.decode()
> > >> > > > UnboundLocalError: local variable 'str' referenced before
> > assignment
> > >> > > >
> > >> > > > I changed it to:
> > >> > > >
> > >> > > > return stdout if type(stdout) is type('str') else
> stdout.decode()
> > >> > > >
> > >> > > > which I now realize is not very clear because any string would
> > have
> > >> > been
> > >> > > > OK, not just 'str'.
> > >> > > >
> > >> > > > —
> > >> > > > You are receiving this because you authored the thread.
> > >> > > > Reply to this email directly, view it on GitHub
> > >> > > > <#1646 (comment)
> > >> 04744273>,
> > >> > > or mute
> > >> > > > the thread
> > >> > > > <https://github.com/notifications/unsubscribe-auth/AP60-
> > >> > > MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
> > >> > > > .
> > >> > > >
> > >> > >
> > >> > > —
> > >> > > You are receiving this because you modified the open/close
state.
> > >> > > Reply to this email directly, view it on GitHub
> > >> > > <#1646 (comment)-
> > 304748964
> > >> >,
> > >> > or mute
> > >> > > the thread
> > >> > > <https://github.com/notifications/unsubscribe-
auth/ADJVuwF3XOMK-
> > >> > sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
> > >> > > .
> > >> >
> > >> > >
> > >> >
> > >> > —
> > >> > You are receiving this because you are subscribed to this thread.
> > >> > Reply to this email directly, view it on GitHub
> > >> > <#1646 (comment)-
> 304749149
> > >,
> > >> or mute
> > >> > the thread
> > >> > <https://github.com/notifications/unsubscribe-auth/
> > >> AKisX66gxr1zxFEsE-4rST-Ve8XSZLiuks5r-2Y4gaJpZM4NoAei>
> > >>
> > >> > .
> > >> >
> > >>
> > >> —
> > >> You are receiving this because you authored the thread.
> > >> Reply to this email directly, view it on GitHub
> > >> <#1646 (comment)-
304749529
> >,
> > >> or mute the thread
> > >> <https://github.com/notifications/unsubscribe-auth/AP60-
> > GeK3EYHlhLpnTgZaOzsRP50K7gwks5r-2dfgaJpZM4NoAei>
> > >> .
> > >>
> > >
> > >
> >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub
> > <#1646 (comment)>,
> or mute
> > the thread
> > <https://github.com/notifications/unsubscribe-auth/AKisXxkUO3XNWEydQ-
> wols3EWrxxUGTXks5r-2k4gaJpZM4NoAei>
> > .
> >
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <#1646 (comment)>,
or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/
ADJVuwS3IzoMFbTzzmVBlrWRkGQrCMvcks5r-2odgaJpZM4NoAei>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AP60-OYeU2dexykFnfWFcNPb4TcLIfURks5r-2qLgaJpZM4NoAei>
.
|
Contributor
|
yes please
…On Mon, May 29, 2017 at 9:05 PM, osadj ***@***.***> wrote:
Sounds good. Should I make a PR then?
On Mon, May 29, 2017 at 9:02 PM, Daniel Povey ***@***.***>
wrote:
> It's OK, the solution he had originally was fine ("is str"), it works in
> both; the only issue was there was a local variable named str which
should
> be renamed.
>
>
>
> On Mon, May 29, 2017 at 9:00 PM, jtrmal ***@***.***>
wrote:
>
> > In that case, I think it's fine to ignore python3 as the developers are
> > idiots
> > y.
> >
> >
> > On Mon, May 29, 2017 at 8:56 PM, osadj ***@***.***>
wrote:
> >
> > > I take that back. This is no longer available (and recommended) in
> > Python3.
> > >
> > >
> > >
> > > On Mon, May 29, 2017 at 8:50 PM, Omid Sadjadi <
> ***@***.***>
> > > wrote:
> > >
> > >
> > > > I like this. Thanks, Yenda.
> > > >
> > > > On Mon, May 29, 2017 at 8:48 PM, jtrmal ***@***.***>
> > > wrote:
> > > >
> > > >> there is python's package types that exports
> > > >> types.StringType
> > > >> types.UnicodeType
> > > >> which I think might be more clear to use
> > > >> y.
> > > >>
> > > >> On Mon, May 29, 2017 at 8:43 PM, Daniel Povey <
> > ***@***.***
> > > >
> > > >>
> > > >> wrote:
> > > >>
> > > >> > There is a local variable in that function called 'str'.
> > > >> > Maybe that could be renamed to something like 'output' and you
> could
> > > >> change
> > > >> > it back to "is str".
> > > >> >
> > > >> >
> > > >> >
> > > >> > On Mon, May 29, 2017 at 8:40 PM, osadj <
***@***.***>
> > > >> wrote:
> > > >> >
> > > >> > > Thanks for letting me know. That is strange because:
> > > >> > >
> > > >> > > Python 3.5.2 (default, Nov 17 2016, 17:05:23)
> > > >> > > [GCC 5.4.0 20160609] on linux
> > > >> > > Type "help", "copyright", "credits" or "license" for more
> > > information.
> > > >> > > >>> type('hello') is str
> > > >> > > True
> > > >> > >
> > > >> > > Python 2.7.12 (default, Nov 19 2016, 06:48:10)
> > > >> > > [GCC 5.4.0 20160609] on linux2
> > > >> > > Type "help", "copyright", "credits" or "license" for more
> > > information.
> > > >> > > >>> type('hello') is str
> > > >> > > True
> > > >> > >
> > > >> > > How would you like to make modify this to make it more clear?
> > > >> > >
> > > >> > > Regards,
> > > >> > > Omid
> > > >> > >
> > > >> > > On Mon, May 29, 2017 at 7:37 PM, Daniel Povey <
> > > >> ***@***.***>
> > > >> > > wrote:
> > > >> > >
> > > >> > > > This did not work, it crashed the scripts.
> > > >> > > >
> > > >> > > > LOG (nnet3-init[5.1]:main():nnet3-init.cc:80) Initialized
raw
> > > >> neural
> > > >> > > net and wrote it to exp/cnn_aug_1b_cifar100/configs//ref.raw
> > > >> > > > nnet3-info exp/cnn_aug_1b_cifar100/configs//ref.raw
> > > >> > > > Traceback (most recent call last):
> > > >> > > > File "steps/nnet3/xconfig_to_configs.py", line 306, in
> <module>
> > > >> > > > main()
> > > >> > > > File "steps/nnet3/xconfig_to_configs.py", line 301, in main
> > > >> > > > check_model_contexts(args.config_dir, args.nnet_edits)
> > > >> > > > File "steps/nnet3/xconfig_to_configs.py", line 265, in
> > > >> > > check_model_contexts
> > > >> > > > .format(model))
> > > >> > > > File "steps/libs/common.py", line 117, in get_command_stdout
> > > >> > > > return stdout if type(stdout) is str else stdout.decode()
> > > >> > > > UnboundLocalError: local variable 'str' referenced before
> > > assignment
> > > >> > > >
> > > >> > > > I changed it to:
> > > >> > > >
> > > >> > > > return stdout if type(stdout) is type('str') else
> > stdout.decode()
> > > >> > > >
> > > >> > > > which I now realize is not very clear because any string
would
> > > have
> > > >> > been
> > > >> > > > OK, not just 'str'.
> > > >> > > >
> > > >> > > > —
> > > >> > > > You are receiving this because you authored the thread.
> > > >> > > > Reply to this email directly, view it on GitHub
> > > >> > > > <https://github.com/kaldi-asr/
kaldi/pull/1646#issuecomment-3
> > > >> 04744273>,
> > > >> > > or mute
> > > >> > > > the thread
> > > >> > > > <https://github.com/notifications/unsubscribe-auth/AP60-
> > > >> > > MqkCCfCWCxC77I9C8BpqDXeMrmhks5r-1bXgaJpZM4NoAei>
> > > >> > > > .
> > > >> > > >
> > > >> > >
> > > >> > > —
> > > >> > > You are receiving this because you modified the open/close
> state.
> > > >> > > Reply to this email directly, view it on GitHub
> > > >> > > <#1646 (comment)-
> > > 304748964
> > > >> >,
> > > >> > or mute
> > > >> > > the thread
> > > >> > > <https://github.com/notifications/unsubscribe-
> auth/ADJVuwF3XOMK-
> > > >> > sUugDs41j3hc3toaMLtks5r-2WagaJpZM4NoAei>
> > > >> > > .
> > > >> >
> > > >> > >
> > > >> >
> > > >> > —
> > > >> > You are receiving this because you are subscribed to this
thread.
> > > >> > Reply to this email directly, view it on GitHub
> > > >> > <#1646 (comment)-
> > 304749149
> > > >,
> > > >> or mute
> > > >> > the thread
> > > >> > <https://github.com/notifications/unsubscribe-auth/
> > > >> AKisX66gxr1zxFEsE-4rST-Ve8XSZLiuks5r-2Y4gaJpZM4NoAei>
> > > >>
> > > >> > .
> > > >> >
> > > >>
> > > >> —
> > > >> You are receiving this because you authored the thread.
> > > >> Reply to this email directly, view it on GitHub
> > > >> <#1646 (comment)-
> 304749529
> > >,
> > > >> or mute the thread
> > > >> <https://github.com/notifications/unsubscribe-auth/AP60-
> > > GeK3EYHlhLpnTgZaOzsRP50K7gwks5r-2dfgaJpZM4NoAei>
> > > >> .
> > > >>
> > > >
> > > >
> > >
> > > —
> > > You are receiving this because you commented.
> > > Reply to this email directly, view it on GitHub
> > > <#1646 (comment)
>,
> > or mute
> > > the thread
> > > <https://github.com/notifications/unsubscribe-
auth/AKisXxkUO3XNWEydQ-
> > wols3EWrxxUGTXks5r-2k4gaJpZM4NoAei>
> > > .
> > >
> >
> > —
> > You are receiving this because you modified the open/close state.
> > Reply to this email directly, view it on GitHub
> > <#1646 (comment)>,
> or mute
> > the thread
> > <https://github.com/notifications/unsubscribe-auth/
> ADJVuwS3IzoMFbTzzmVBlrWRkGQrCMvcks5r-2odgaJpZM4NoAei>
>
> > .
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1646 (comment)>,
or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AP60-
OYeU2dexykFnfWFcNPb4TcLIfURks5r-2qLgaJpZM4NoAei>
> .
>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1646 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADJVu9IPsLKVcGauDMe1w_6uZVo7ZZRZks5r-2tsgaJpZM4NoAei>
.
|
danpovey
pushed a commit
that referenced
this pull request
May 30, 2017
Skaiste
pushed a commit
to Skaiste/idlak
that referenced
this pull request
Sep 26, 2018
Skaiste
pushed a commit
to Skaiste/idlak
that referenced
this pull request
Sep 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.