【问题标题】:Exception raised: cannot import name 'manual_seed' from 'torch'引发异常:无法从 \'torch\' 导入名称 \'manual_seed\'
【发布时间】:2022-09-30 06:13:35
【问题描述】:

我正在尝试在我的设备上运行 AutoClean 项目(这是我的代码):

import random
from AutoClean import AutoClean
import pandas as pd


def __init__(self, pipeline, resultat ):
    self.pipeline = pipeline
    self.resultat = resultat
    resultat = pd.read_csv(r\"C:\\Users\\radia\\Downloads\\result-(11)-csv.csv\", profileUrl = \'str\', fullName = \'str\', firstName = \'str\', lastName = \'str\', profileImage = \'str\' , additionnalInfo = \'str\' , connectionDegree = \'str\', job = \'str\', location = \'str\', sharedConnections = \'str\', commonConnection1 = \'str\', url = \'str\', name = \'str\' , query = \'str\', category = \'str\', timestamp = \'NoneType\', commonConnection = \'str\', error = \'NoneType\') 
    pipeline = AutoClean(resultat, mode = \'manual\', duplicates = \'True\', missing_num = \'linreg\', missing_categ = \'auto\', encode_categ = \'False\', extract_datetime = \'auto\', outliers = \'delete\', outlier_param = \'1.5\', logfile = \'True\', verbose = \'True\')
    for pipeline in self.pipeline:
        print(pipeline.head())

但是我得到了这个异常并且无法理解为什么,特别是因为我从 3 天前开始测试这个并且从未得到它,所以我真的不明白

Une exception s\'est produite : ImportError
cannot import name \'manual_seed\' from \'torch\' (unknown location)

    标签: python github repository


    【解决方案1】:

    为了从 AutoClean 获取结果数据帧,您必须调用输出来自管道对象的参数:

    df = pipeline.output

    如果您只想要数据帧的 head(),您可以执行以下操作:

    pipeline.output.head()

    更多细节可以参考官方 repo 中的文档:https://github.com/elisemercury/AutoClean

    希望这可以帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-18
      • 2022-01-08
      • 2023-02-02
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      • 2015-12-15
      • 1970-01-01
      相关资源
      最近更新 更多