Models: Failing model_test.py after steps required

Created on 14 Oct 2018  路  13Comments  路  Source: tensorflow/models

I tried to install via the following commands on my Mac (MacBook Pro (13-inch, 2016), macOS Mojave Version 10.14)

cd .../anaconda/lib/python3.5/site-packages
cd tensorflow
git clone https://github.com/tensorflow/models.git
cd models
cd research
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
python deeplab/model_test.py

After giving this warning,

I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

Terminal shows this message to me

F....
======================================================================
FAIL: testBuildDeepLabWithDensePredictionCell (__main__.DeeplabModelTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "deeplab/model_test.py", line 141, in testBuildDeepLabWithDensePredictionCell
    expected_endpoints)
AssertionError: First sequence is not a list: dict_keys(['merged_logits'])

----------------------------------------------------------------------
Ran 5 tests in 18.835s

Is Anaconda triggering the problem for me?

Most helpful comment

I guess you use python>=3.0 , therefore the code in model_test.py line: 140
self.assertListEqual(scales_to_model_results.keys(),
can not work.

change it to self.assertListEqual(list(scales_to_model_results.keys()),

detail see the model_test.py history https://github.com/tensorflow/models/commit/834902277b8d9d38ef9982180aadcdaa0e5d24d3#diff-046f4d20ab75f920be0e2ab2dc352a91

All 13 comments

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
What is the top-level directory of the model you are using
Have I written custom code
OS Platform and Distribution
TensorFlow installed from
TensorFlow version
Bazel version
CUDA/cuDNN version
GPU model and memory
Exact command to reproduce

Hi, thank you for the quick reply. For some of the questions, I can provide an answer:

  • What is the top-level directory of the model you are using: I use Python through Anaconda, so the site packages are installed here: /Users/my own username/anaconda/lib/python3.5/site-packages
  • Have I written custom code: No, I didn't do anything
  • OS Platform and Distribution: macOS Mojave Version 10.14, single laptop with Processor: 3.1 GHz Intel Core i5 and Memory: 16 GB 2133 MHz LPDDR3
  • TensorFlow installed from: Terminal: pip install tensorflow
  • TensorFlow version: 1.11.0 (I'm not using GPU version tensorflow-gpu)
  • Bazel version: NA, do not know what Bazel is and did not interact with it
  • CUDA/cuDNN version: NA, running on local 4-core macbook-pro
  • GPU model and memory: NA, graphics is Intel Iris Graphics 550 1536 MB
  • Exact command to reproduce:

pip install tensorflow
cd /Users/my own username/anaconda/lib/python3.5/site-packages
cd tensorflow
git clone https://github.com/tensorflow/models.git
cd models
cd research
export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim
python deeplab/model_test.py

I guess you use python>=3.0 , therefore the code in model_test.py line: 140
self.assertListEqual(scales_to_model_results.keys(),
can not work.

change it to self.assertListEqual(list(scales_to_model_results.keys()),

detail see the model_test.py history https://github.com/tensorflow/models/commit/834902277b8d9d38ef9982180aadcdaa0e5d24d3#diff-046f4d20ab75f920be0e2ab2dc352a91

Wow! Was tensorflow 1.11.0 written in python2 ?? I certainly did not look at that.

Do you mean the model_test.py was written in py27?

So do I need to run the DeepLab in Python 2.7?

I'm using Python 3.6, and following @myBestLove 's instructions, was able to, successfully, run model_test.py. There's two instances where you need to change the line. Just replace scales_to_model_results.keys() with list(scales_to_model_results.keys()).

I had a similar error earlier but then changing the two instances I got a different error that is

self.assertListEqual(list(scales_to_model_results.keys()),1)
AssertionError: Second sequence is not a list: 1

Same configs as [syin3]

I have solved it with the method by @DrFrazerNoble

Closing as this is resolved

Solved @myBestLove

@reetc i have use deeplab r1.12.0 and after repalced problem solved

well,thank your help ! @myBestLove

Was this page helpful?
0 / 5 - 0 ratings