Ghana's people went to the polls today to elect civilian leaders, despite uncertainty about their country's future under its two-week-old military government.

Ghana, which two decades ago was the beacon of independence for liberation movements sweeping Africa, held its third election in 22 years of independence under the shadow of its fourth military coup.

Polling places in Accra were busy despite fresh memories of the June 4 coup and the execution by firing squad on Saturday of former president Ignatius Acheampong and an aide. Political observers estimated that about half of the country's 5 million registered voters would cast ballots for a president, vice president and 140-member parliament.

There are 10 candidates - six of them backed by political parties - seeking the presidency, and no clear front-runner.

"This is the first election in 10 years and this Revolutionary Council coup has added an ingredient to the election atmosphere that no one can measure," said one Western diplomatic source. "The election can go to anyone."

The four candidates generally recognized as front runners are: Hilla Liman, a career diplomat regarded as a moderate leftist; Victor Owusu and William Oforo-Atta, of two moderate and procapitalist parties, and Ibrahim Mahama, who has trade union backing and a platform that reflects the anticorruption stand of the Revolutionary Council.

It was not certain, however, when the civilian government would be permitted to take office.

Flight Lt. J. J. "Jerry" Rawlings, who led the June 4 coup, has said the military will yield power to the new government by Oct. 1. His 14-member Revolutionary Council of junior officers and enlisted men, however, has said it might turn over power earlier if it is convinced the civilian government will vigorously pursue the anticorruption "housecleaning" begun since the coup.

Acheampong, who ruled Ghana for six years, and Gen. E. K. Utuka, former head of the border guard, were executed after being convicted in a two-hour trial by a military tribunal of "using their positions to amass wealth."

A number of other high-level military officers and civilian businessmen have been imprisoned on charges of economic crimes, and the Revolutionary Council has said there will be more executions.

If the top vote-getter in today's election does not win at least 50 percent of the vote, a runoff will be held between the two leading candidates, an uneasy prospect in the tense postcoup atmosphere.

"This is no time to have a drawn-out fight," said one high-level civil servant. "Whoever wins, I hope he wins big so we can hold the Council to their promise" to relinquish power.

That promise was reiterated by Rawlings in a broadcast appeal to voters to exercise their franchise "without fear." He added that "the Revolutionary Council will be loyal to any elected civilian government."

Rawlings described the people who would be tried by military tribunals as those who have participated in an "unfair distribution of the national cake" when Ghana's "coffers are empty."

The Revolutionary Council has also frozen the assets of many military officers, businessmen, civilian administrators and their families pending investigations of how their property was obtained.

Ghana's economic plight is evident in the startling decay seen by a visitor who last visited Accra nine years ago. The streets are full of potholes and strewn with cars abandoned for lack of spare parts.

Shops have little to sell and people wait patiently in long lines to buy limited quantities of newspapers.

On the thriving black market an egg costs 30 cents, although the head of a family may earn only $5 a day.

Factories, lacking raw materials, operate at one-third capacity, but goods "made in Ghana" are readily available in neighboring Togo, where they are smuggled for hard currency. Even Ghana's fishermen reportedly take their catches to Ivory Coast.