Skip to content

Error importing tensorflow #810

Closed
Closed

Description

@habrman

I had a problem with the cifar10 example. When running cifar10_eval.py I got:
"AttributeError: 'ExponentialMovingAverage' object has no attribute 'variables_to_restore'"

I then saw #802 and tried to follow the instructions for "Installing from sources" on the website. Now I get a new error when trying to import tensorflow:

Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.

How do I solve this? I'm using ubuntu 15.04.

Activity

  1. vrv commented on Jan 20, 2016

    @vrv
    1. You might go back to AttributeError: 'ExponentialMovingAverage' object has no attribute 'variables_to_restore' #802 and checking out the code at the 0.6.0 branch if you have installed the pip package at 0.6.0.

    2. As the instructions say, you can't import tensorflow when running in the root of the source tree. Go to another directory and you should be able to import it.

    Let us know if you have any problems and we'll reopen this ticket.

  2. habrman commented on Jan 20, 2016

    @habrman
    Author

    I must have missed to uninstall something before. After uninstalling and redoing all the steps the source works. However, I now get a new error when running cifar10_eval.py. The training runs fine but during evaluation I get the output below when running the file. I get the same output if I use the pip installation and use the cifar10_eval.py from the 0.6.0 branch.

    2016-01-20 12:05:07.620594: precision @ 1 = 0.661
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e8c0015d0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2ec00515c0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2eb00018d0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2eb4001840 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2ea8001610 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e880016e0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e98001660 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2ec806eae0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: input_producer/input_producer_EnqueueMany = QueueEnqueueMany[Tcomponents=[DT_STRING], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](input_producer, input_producer/RandomShuffle)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2eb80018e0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e780015d0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e90001c10 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e9c001b70 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2eac001970 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e800015d0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2e940015d0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2ebc04c1e0 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    W tensorflow/core/common_runtime/executor.cc:1091] 0x7f2ea0001610 Compute status: Cancelled: Enqueue operation was cancelled
    [[Node: shuffle_batch/random_shuffle_queue_enqueue = QueueEnqueue[Tcomponents=[DT_FLOAT, DT_INT32], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](shuffle_batch/random_shuffle_queue, Div, Cast)]]
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt
    I tensorflow/core/kernels/queue_base.cc:283] Skipping cancelled enqueue attempt

  3. added a commit that references this issue on Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions