python - Python问题:TypeError:强制转换为Unicode:需要字符串或缓冲区,找到NoneType
问题描述
我正在尝试在使用 python 2.7 的 conda 环境中使用 DeepChem 库版本 2.0.0。我不断遇到这个错误:
Traceback (most recent call last):
File "test_run_benchmark_models.py", line 30, in <module>
seed=123)
File "/home/ha01994/miniconda2/envs/project/lib/python2.7/site-packages/deepchem/molnet/run_benchmark.py", line 153, in run_benchmark
featurizer=featurizer, reload=reload)
File "/home/ha01994/miniconda2/envs/project/lib/python2.7/site-packages/deepchem/molnet/load_function/bace_datasets.py", line 80, in load_bace_classification
save_dir = os.path.join(data_dir, "bace_c/" + featurizer + "/" + str(split))
TypeError: coercing to Unicode: need string or buffer, NoneType found
这是第 80 行附近的代码:
def load_bace_classification(featurizer='ECFP', split='random', reload=True):
"""Load bace datasets."""
# Featurize bace dataset
print("About to featurize bace dataset.")
data_dir = deepchem.utils.get_data_dir()
if reload:
save_dir = os.path.join(data_dir, "bace_c/" + featurizer + "/" + str(split))
dataset_file = os.path.join(data_dir, "bace.csv")
if not os.path.exists(dataset_file):
deepchem.utils.download_url('http://deepchem.io.s3-website-us-west-1.amazonaws.com/datasets/bace.csv'
)
任何帮助,将不胜感激。谢谢!
解决方案
推荐阅读
- r - 在循环中引用数据表列名称中的数字
- ios - 在 info.plist 上放置一个资源字符串(来自 infoPlist.strings)
- wordpress - 如何为 Wordpress 设置 qTranslate 以自动为我提供德语,尽管我的网站语言是英语
- python - Python函数:f是什么意思?
- java - 如何使用 Spring Boot 设置 Spring JDBC 连接池?
- c# - 添加后无法使用ac#引用
- python - 在 python 中使用 selenium 创建一个用于网络抓取的循环
- syntax - 函数名和左括号之间的 Coffeescript 空格
- jquery - 下拉按钮不起作用也没有消失
- python-3.x - 如何用自定义类替换 h5py.AttributeManager?