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

/tutorials/rnn/translate/translate.py throws TypeError: can't pickle _thread.lock objects #1790

Closed
ghost opened this issue Jun 28, 2017 · 10 comments
Labels
stat:awaiting model gardener Waiting on input from TensorFlow model gardener type:build/install

Comments

@ghost
Copy link

ghost commented Jun 28, 2017

System information

  • What is the top-level directory of the model you are using:
    models/tutorials/rnn/translate/
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
    No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    Windows 10
  • TensorFlow installed from (source or binary):
    Pip install
  • TensorFlow version (use command below):
    1.2.0
  • Bazel version (if compiling from source):
    n/a
  • CUDA/cuDNN version:
    Not GPU
  • GPU model and memory:
    Not GPU
  • Exact command to reproduce:
    Run translate.py

Describe the problem

When I run translate.py, it loads all the data from the internet on first run, then creates 3 layers of 1024 units, then crashes with the log below. I believe the issue lies with having a list of buckets with len > 1.

Source code / logs

https://pastebin.com/5PQeXx0J
Stack-Overflow with more details:
https://stackoverflow.com/questions/44855603/typeerror-cant-pickle-thread-lock-objects-in-seq2seq

@richardsun-voyager
Copy link

richardsun-voyager commented Jun 28, 2017

I ran into the same problem on my MacBook Pro, I thought perhaps there were some bugs in the new version 1.2.0, so I switched to Tensorflow 1.0.0 version and it worked. Will anybody give any clues to solve it?

@matteo-brucato
Copy link

I'm having the same issue.

@ali01
Copy link

ali01 commented Jun 30, 2017

@panyx0718, any thoughts on this?

@ali01 ali01 added stat:awaiting model gardener Waiting on input from TensorFlow model gardener type:build/install labels Jun 30, 2017
@ghost
Copy link
Author

ghost commented Jun 30, 2017

@ali01 Update: I actually get the issue on my own project too. It appears to only occur when a bucket of length > 1 is fed to the model ([100, 100), (200, 200)] fails while ([100, 100]) works fine.

For more details, I linked the Stackoverflow in the main issue post.

@richardsun-voyager
Copy link

Well, I created a virtual environment by conda prompt on my Mac, installed python3.6 and tensorflow 1.0.0 along with kernel. Then I switched to tensorflow 1.0.0 kernel in my jupyter notebook.

@dxteam2024
Copy link

dxteam2024 commented Jul 23, 2017

try to delete the file named 'pycache' in your python workspace , i have the same problem and fixed in this way

@Jacobh2
Copy link

Jacobh2 commented Jul 29, 2017

I get the same problem as OP, also get the exact same error log.

I'm also running Windows 10, and have tried both with and without gpu support on Tensorflow 1.2.0.

I get it to work if I change the list of buckets (_bucket) to length 1 and makes sure the __pycache__ folder is deleted (if I've done any failing runs before)

@DongjunLee
Copy link

also i have the same issue.

voidgit added a commit to voidgit/models that referenced this issue Oct 14, 2017
@guotong1988
Copy link

same problem ...

@maxim5
Copy link

maxim5 commented Jan 28, 2018

@DongjunLee @guotong1988

Try the answer suggested on StackOverflow:

setattr(tf.contrib.rnn.GRUCell, '__deepcopy__', lambda self, _: self)
setattr(tf.contrib.rnn.BasicLSTMCell, '__deepcopy__', lambda self, _: self)
setattr(tf.contrib.rnn.MultiRNNCell, '__deepcopy__', lambda self, _: self)

@wt-huang wt-huang closed this as completed Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting model gardener Waiting on input from TensorFlow model gardener type:build/install
Projects
None yet
Development

No branches or pull requests

9 participants