报错

C:\myProgram\anaconda3\envs\pfedln\python.exe D:\myCode\python_Programs-master\pFedLN\main.py
Traceback (most recent call last):
File “D:\myCode\python_Programs-master\pFedLN\main.py”, line 1, in
import torch
File “C:\myProgram\anaconda3\envs\pfedln\lib\site-packages\torch_init_.py”, line 130, in
raise err
OSError: [WinError 182] 操作系统无法运行 %1。 Error loading “C:\myProgram\anaconda3\envs\pfedln\lib\site-packages\torch\lib\fbgemm.dll” or one of its dependencies.

进程已结束,退出代码为 1

尝试1

方案一:修复 intel-openmp 冲突(最常见原因)
在 pfedln 环境中强制从默认渠道重新安装 intel-openmp:

conda install -n pfedln -c defaults intel-openmp -f

报错

(pFedLN) PS D:\myCode\python_Programs-master\pFedLN> python main.py
Prepare parameter holders
Namespace(adj_data=‘data/sensor_graph/adj_mx.pkl’, adjalpha=3, adjbeta=0.05, agg=‘perLayer’, batch_size=256, bn=0, cl=1, client_epochs=1, client_frac=1, clients=339, clip=5, com_round=100, conv_channels=32, dataaug=0, dataset=‘1’, dataset_density=0.1, debug=0, deep=0, device=device(type=‘cpu’), dilation_exponential=1, dp=0.005, dropout=0.3, edge_frac=1, end_channels=128, epoch=1, epsilon=1, evalall=0, gc_epoch=10, gcn_depth=2, hidden=[10, 20, 320, 50], in_dim=2, keepList=[0, 1, 5, 6, 7], kernel_num=9, kernel_sizes=‘3,4,5’, layers=3, logDir=‘log/1-perLayer-0.1-0.01-100-default.txt’, lr=0.01, max_pool=‘True’, node_dim=40, norm=‘batch_norm’, normalization_parameter=19.9, num_channels=1, num_classes=10, num_filters=32, num_split=1, num_thread=5, ord=2, print_every=100, propalpha=0.05, reg=1, residual_channels=32, rnn_hidden=64, runs=10, save=‘./save/’, seed=1, seq_in_len=12, seq_out_len=12, serveralpha=1, serverbeta=0.3, shards=2, skip_channels=64, sm=‘full’, step_size1=2500, step_size2=100, subgraph_size=30, unequal=0, valid_freq=5, weight_decay=0.0001)
Number of model parameters is 199425
Start Training…
Traceback (most recent call last):
File “main.py”, line 131, in
main(option)
File “main.py”, line 50, in main
outputs = engine.run()
File “D:\myCode\python_Programs-master\pFedLN\federated.py”, line 41, in run
output = self.client_run()
File “D:\myCode\python_Programs-master\pFedLN\federated.py”, line 57, in client_run
mean_MAE.append(stats.mean(‘MAE’))
File “D:\myCode\python_Programs-master\pFedLN\util.py”, line 85, in mean
return np.mean(to_numpy(self.stats(key)), dtype=np.float)
File “C:\myProgram\anaconda3\envs\pFedLN\lib\site-packages\numpy_init_.py”, line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module ‘numpy’ has no attribute ‘float’.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

尝试

得试试其他numpy版本,有float,就下载了1.19.5版本

conda run -n <environment_name> pip install numpy==1.19.5
# numpy换了,scipy也要换,对应的就是以下这个版本
conda run -n <environment_name> pip install scipy==1.10.1
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐