Giter Club home page Giter Club logo

Comments (9)

hamzatrq avatar hamzatrq commented on August 24, 2024 2

@zhuhaozh the segmentation fault is caused by the flownet2-pytorch dependency in this model. Which required pytorch 0.4.1. I suggest that you use docker. Here is my dockerfile that works I hope it helps.

FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04

RUN apt-get update && apt-get install -y \
    curl \
    ca-certificates \
    sudo \
    git \
    bzip2 \
    libx11-6 \
    build-essential \
 && rm -rf /var/lib/apt/lists/*
 
# Create a working directory
RUN mkdir /app
WORKDIR /app


# Create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
 && chown -R user:user /app
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user

# All users can use /home/user as their home directory
ENV HOME=/home/user
RUN chmod 777 /home/user


# Install Miniconda
RUN curl -so ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh \
 && chmod +x ~/miniconda.sh \
 && ~/miniconda.sh -b -p ~/miniconda \
 && rm ~/miniconda.sh
ENV PATH=/home/user/miniconda/bin:$PATH
ENV CONDA_AUTO_UPDATE_CONDA=false


# Create a Python 3.6 environment
RUN /home/user/miniconda/bin/conda create -y --name py36 python=3.6.9 \
 && /home/user/miniconda/bin/conda clean -ya
ENV CONDA_DEFAULT_ENV=py36
ENV CONDA_PREFIX=/home/user/miniconda/envs/$CONDA_DEFAULT_ENV
ENV PATH=$CONDA_PREFIX/bin:$PATH
RUN /home/user/miniconda/bin/conda install conda-build=3.18.9=py36_3 \
 && /home/user/miniconda/bin/conda clean -ya

RUN conda install -y -c pytorch pytorch=1.3.1 torchvision=0.4.2 \
 && conda clean -ya

# Install HDF5 Python bindings
RUN conda install -y h5py=2.8.0 \
 && conda clean -ya
RUN pip install h5py-cache==1.0

# Install Torchnet, a high-level framework for PyTorch
RUN pip install torchnet==0.0.4

# Install Requests, a Python library for making HTTP requests
RUN conda install -y requests=2.19.1
 
# Install Graphviz
RUN conda install -y graphviz=2.40.1 python-graphviz=0.8.4

# Install Scikit Image
RUN conda install -y -c anaconda scikit-image

# Install OpenCV3 Python bindings
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends \
    libgtk2.0-0 \
    libcanberra-gtk-module \
 && sudo rm -rf /var/lib/apt/lists/*
 
RUN conda install -y -c conda-forge opencv dominate dlib pillow=6.1 \
 && conda clean -ya

RUN git clone https://github.com/NVlabs/few-shot-vid2vid
WORKDIR /app/few-shot-vid2vid/
RUN python scripts/download_datasets.py

# Set the default command to bash
CMD ["/bin/bash"]

from few-shot-vid2vid.

nfrik avatar nfrik commented on August 24, 2024

It does work with pytorch 1.1.0

from few-shot-vid2vid.

zhuhaozh avatar zhuhaozh commented on August 24, 2024

Hi, @nfrik
I use pytorch1.1.0, but encountered the segment fault. I cannot install pytorch1.2.0 on the server... so, i don't know whether it is caused by the version of pytorch

image

from few-shot-vid2vid.

AaronWong avatar AaronWong commented on August 24, 2024

Hi, @zhuhaozh
Can you use docker?

from few-shot-vid2vid.

nfrik avatar nfrik commented on August 24, 2024

Hi, @nfrik
I use pytorch1.1.0, but encountered the segment fault. I cannot install pytorch1.2.0 on the server... so, i don't know whether it is caused by the version of pytorch

image

I doubt that segmentation fault is caused by pytorch version. There could be many factors causing that, but you might need to upgrade/downgrade your numpy version. Also try to rerun your code, since each time generator is initialized with random state.

from few-shot-vid2vid.

zhuhaozh avatar zhuhaozh commented on August 24, 2024

Thanks, I will try it later.

from few-shot-vid2vid.

scarymrgrey avatar scarymrgrey commented on August 24, 2024

@hamzatrq Thanks for your Dockerfile! But which version of Pillow you are using?
I'm getting "ImportError: cannot import name 'PILLOW_VERSION'"

from few-shot-vid2vid.

hamzatrq avatar hamzatrq commented on August 24, 2024

Pillow is updated to version 7, but we need version 6. Please run:

$ conda install pillow=6.1

Also updated the dockerfile above.

from few-shot-vid2vid.

nalzok avatar nalzok commented on August 24, 2024

Thanks, @hamzatrq! Can you also share docker-compose.yml with us? I have not used Docker before, but the document indicates that we'll also need that file to define an environment.

from few-shot-vid2vid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.