yahoo / open_nsfw

Not Suitable for Work (NSFW) classification using deep neural network Caffe models.
BSD 2-Clause "Simplified" License
5.86k stars 1.05k forks source link

ImportError: cannot import name main #83

Open akhanivishant opened 5 years ago

akhanivishant commented 5 years ago

Hi , while running : docker build -t caffe:cpu https://raw.githubusercontent.com/BVLC/caffe/master/docker/cpu/Dockerfile This command , i am getting error at your step 7 , when you are updating pip version.

File "/usr/bin/pip", line 9, in from pip import main ImportError: cannot import name main

As i have already installed latest pip version but when you update in it's giving error because of pip.

mmrblack commented 5 years ago

I have same problem.

mmrblack commented 5 years ago

@akhanivishant I find a way to solve this problem.

  1. run this command 'docker run -ti bvlc/caffe:cpu caffe --version' instead 2.then run 'docker run --volume=$(pwd):/workspace bvlc/caffe:cpu python ./classify_nsfw.py --model_def nsfw_model/deploy.prototxt --pretrained_model nsfw_model/resnet_50_1by2_nsfw.caffemodel test_image.jpg' It works!
sxl613 commented 5 years ago

@akhanivishant I got it to work by changing do pip install $req;

to

do python -m pip install $req;

in the Dockerfile.