scikit-opt icon indicating copy to clipboard operation
scikit-opt copied to clipboard

Google colab GPU环境下导包报错

Open gordonguo98 opened this issue 4 years ago • 1 comments

RuntimeError Traceback (most recent call last) in () ----> 1 from sko.PSO import PSO 2 from sko.GA import GA

4 frames /usr/local/lib/python3.7/dist-packages/sko/init.py in () 1 version = '0.6.5' 2 ----> 3 from . import DE, GA, PSO, SA, ACA, AFSA, IA, tools 4 5

/usr/local/lib/python3.7/dist-packages/sko/DE.py in () 9 from abc import ABCMeta, abstractmethod 10 from .operators import crossover, mutation, ranking, selection ---> 11 from .GA import GeneticAlgorithmBase, GA 12 13

/usr/local/lib/python3.7/dist-packages/sko/GA.py in () 7 import numpy as np 8 from .base import SkoBase ----> 9 from sko.tools import func_transformer 10 from abc import ABCMeta, abstractmethod 11 from .operators import crossover, mutation, ranking, selection

/usr/local/lib/python3.7/dist-packages/sko/tools.py in () 7 8 if sys.platform != 'win32': ----> 9 multiprocessing.set_start_method('fork') 10 11

/usr/lib/python3.7/multiprocessing/context.py in set_start_method(self, method, force) 240 def set_start_method(self, method, force=False): 241 if self._actual_context is not None and not force: --> 242 raise RuntimeError('context has already been set') 243 if method is None and force: 244 self._actual_context = None

RuntimeError: context has already been set

gordonguo98 avatar Aug 27 '21 14:08 gordonguo98

我没有这个环境,能否帮忙看一下 sys.platform 返回的是什么吗?

guofei9987 avatar Sep 27 '21 11:09 guofei9987