MauroZMJ / Deep_Learning_based_Low_complexity_MIMO_Precoding_Design

9 stars 2 forks source link

broadcast #1

Closed 123malo closed 1 month ago

123malo commented 3 months ago

在运行python3 generate_dataset/generate_dataset.py --Nt 64 --Nr 4 --K 8 --dk 2 --B 1 --SNR 0 --SNR_channel 100 --gpu 0 --mode gpu --batch_size 200 --epoch 1000 --factor 时,出现了如下错误 Traceback (most recent call last): File "C:\Users\xzq12\Desktop\Deep_Learning_based_Low_complexity_MIMO_Precoding_Design-main\generate_dataset\generate_dataset.py", line 402, in rb_allocate_vec[i 1000:(i + 1) 1000, :] = q_list.numpy() ValueError: could not broadcast input array from shape (125,32) into shape (1000,32)

MauroZMJ commented 1 month ago

你好,我从头重新运行了一下代码,没有出现你说的这个问题。你的报错可能是产生信道的函数generate_dataset/generate_channel.py中设定不正确,我已经修改默认的设置,希望可以对你有所帮助。

123malo commented 1 month ago

好的,但我用显卡运行时会报错,这是什么原因呢? Traceback (most recent call last): File "C:\Users\lth\Desktop\Deep_Learning_based_Low_complexity_MIMO_Precoding_Design-main\differ_ds\learn_from_bar_merge_rb_old.py", line 47, in data_process(data_root,Nt,Nr,dk,K,B,SNR_dB,SNR_channel_dB,test_length,data_mode) File "C:\Users\lth\Desktop\Deep_Learning_based_Low_complexity_MIMO_Precoding_Design-main\differ_ds\learn_from_bar_merge_rb_preprocessing.py", line 98, in data_process H_miso_iter,H_miso_bar_iter = MIMO2MISO(channel=H_iter, Nt=Nt, Nr=Nr, dk=dk, K=K, B=B) File "C:\Users\lth\Desktop\Deep_Learning_based_Low_complexity_MIMO_Precoding_Design-main\differ_ds\learn_from_bar_merge_rbpreprocessing.py", line 50, in MIMO2MISO s, , v = tf.linalg.svd(H_this_user) File "D:\Anaconda3\envs\torchflow\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper return target(*args, **kwargs) File "D:\Anaconda3\envs\torchflow\lib\site-packages\tensorflow\python\ops\linalg_ops.py", line 547, in svd s, u, v = gen_linalg_ops.svd( File "D:\Anaconda3\envs\torchflow\lib\site-packages\tensorflow\python\ops\gen_linalg_ops.py", line 2348, in svd _ops.raise_from_not_ok_status(e, name) File "D:\Anaconda3\envs\torchflow\lib\site-packages\tensorflow\python\framework\ops.py", line 6843, in raise_from_not_ok_status six.raise_from(core._status_to_exception(e.code, message), None) File "", line 3, in raise_from tensorflow.python.framework.errors_impl.InternalError: Failed copying input tensor from /job:localhost/replica:0/task:0/device:GPU:0 to /job:localhost/replica:0/task:0/device:CPU:0 in order to run Svd: GPU sync failed [Op:Svd]

Process finished with exit code 1

MauroZMJ commented 1 month ago

从错误描述上看应该是tensorflow做SVD运算时报错,建议更新tensorflow版本